帮我看看错在那里!急(贴子长.分两贴..)

SEASKYLONG 2004-01-10 10:20:21
<!--#include file="conn.asp"-->
<!--#include file="top.asp"-->
<!--#include file="md5.asp"-->

<%
dim action
action=request("action")

if action="step2" then

dim username
username=checkstr(trim(request.form("username")))
if username="" then
call mb("请输入登陆帐号!","",0)
end if

set rs=server.createobject("adodb.recordset")
sql="select question from author where username='"&username&"'"
rs.open sql,conn,1,1

if rs.bof and rs.eof then
call mb("对不起,找不到此登陆帐号!","",0)
else
%>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="border">
<tr>
<td width="190" valign="top" bgcolor="#F7F7F7">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="22"><img src="images/left_getpwd.gif" alt="获取密码" width="190" height="34" border="0"></td>
</tr>
<tr>
<td height="22" align="center"> </td>
</tr>
<tr>
<td height="22" align="center"> √<font color="#000000"> 填写登陆帐号</font></td>
</tr>
<tr>
<td height="22" align="center">↓</td>
</tr>
<tr>
<td height="22" align="center">→<font color="#FF0000"> 填写密码答案</font></td>
</tr>
<tr>
<td height="22" align="center">↓</td>
</tr>
<tr>
<td height="22" align="center">获取您的密码</td>
</tr>
<tr>
<td height="22"> </td>
</tr>
<tr>
<td height="22"> </td>
</tr>
</table>
</td>
<td width="1" valign="top" background="images/bg_vline.gif"></td>
<td valign="top"> <TABLE align=center
background="images/line01.gif"
border=0 cellPadding=0 cellSpacing=0 height=24 width="100%">
<TR>
<TD height=21 width="63%"> <IMG height=12 src="images/A3.gif" width=12>
当前位置:<A href="index.asp">网络展示中心</A> -> 获取登陆密码 ->
填写密码答案 </TD>
<TD height=21 width="37%"> </TD>
</TR>
</TABLE>
<form action="?action=step3" method="post" name="getpassword" id="getpassword">
<TABLE align=center border=0 borderColor=#000000 cellPadding=0
cellSpacing=0 width="99%">
<TR>
<TD
background="images/T_back.gif"
width="18%"><IMG src="images/T_1.gif" width=90 height=24 border="0"></TD>
<TD
background="images/T_back.gif"
width="77%"> <font color="#993300">获 取 登 陆 密 码</font></TD>
<TD width="5%"><IMG height=24 src="images/T_2.gif" width=29></TD>
</TR>
</TABLE>
<table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="#FFFFFF">
<td width="23%" height="25" align="center">密码问题:  </td>
<td width="77%" height="25"><b><%=rs(0)%></b></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25" align="center">密码答案: </td>
<td height="25">
<input name="answer" type="text" class="input" id="answer" size="25"></td>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<td height="30" colspan="2">
<input name="username" type="hidden" id="username" value="<%=username%>">
<input name="Submit4" type="button" class="button" value=" 上一步" onclick="javascript:history.go(-1);">
<input name="Submit3" type="submit" class="button" value=" 下一步 ">
</td>
</tr>
</table>
</form>
<p> </p></td>
</tr>
</table>
<%
end if
rs.close
set rs=nothing

elseif action="step3" then

dim answer
username=checkstr(request.form("username"))
answer=checkstr(trim(request.form("answer")))

if username="" then
call mb("对不起,请指定要取回密码的登陆帐号!","getpassword.asp",1)
end if

if answer="" then
call mb("请输入密码答案!","",0)
end if

set rs=conn.execute("select answer,userpassword from author where username='"&username&"'")
if rs.bof and rs.eof then
call mb("对不起,找不到此帐号信息!","getpassword.asp","")
elseif rs(0)<>answer then
call mb("对不起,密码答案不正确!","",0)
else
%>
...全文
30 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
SEASKYLONG 2004-01-11
  • 打赏
  • 举报
回复
<%
end if
rs.close
set rs=nothing

elseif action="save" then

if request("action")="save" then
dim password
password=checkstr(trim(request.form("password")))

if password="" or strlength(password)>30 then
call mb("密码不能为空或大于30字长!","",0)
end if

set rs=server.createobject("adodb.recordset")
sql="select * from author where username='"&"username"&"'"
rs.open sql,conn,1,3

if not(rs.bof and rs.eof) then
rs("userpassword")=md5(password,"long")
rs.update
else
call mb("对不起,找不到您的帐号!","",0)
end if
end if
rs.close
set rs=nothing
else
%>



---------------------------------------
我改成这样之后.这样提示的错误是没有找到你的帐号.
要怎么样写入呢?
say1no2 2004-01-10
  • 打赏
  • 举报
回复
太长了,眼看花了!
SEASKYLONG 2004-01-10
  • 打赏
  • 举报
回复
上面两个是一页程序.
SEASKYLONG 2004-01-10
  • 打赏
  • 举报
回复
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="border">
<tr>
<td width="19" valign="top" bgcolor="#F7F7F7">
<table width="96%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="22"><img src="images/left_getpwd.gif" alt="获取密码" width="190" height="34" border="0"></td>
</tr>
<tr>
<td height="22" align="center"> </td>
</tr>
<tr>
<td height="22" align="center"> √ <font color="#000000">填写登陆帐号</font></td>
</tr>
<tr>
<td height="22" align="center">↓</td>
</tr>
<tr>
<td height="22" align="center">√ 填写密码答案</td>
</tr>
<tr>
<td height="22" align="center">↓</td>
</tr>
<tr>
<td height="22" align="center">→ <font color="#FF0000">获取您的密码</font></td>
</tr>
<tr>
<td height="22"> </td>
</tr>
<tr>
<td height="22"> </td>
</tr>
</table>
</td>
<td width="1" valign="top" background="images/bg_vline.gif"><br>
</td>
<td valign="top"><TABLE align=center
background="images/line01.gif"
border=0 cellPadding=0 cellSpacing=0 height=24 width="100%">
<TR>
<TD height=21 width="63%"> <IMG height=12 src="images/A3.gif" width=12>
当前位置:<A href="index.asp">网络展示中心</A> -> 获取登陆密码 ->
获取密码</TD>
<TD height=21 width="37%"> </TD>
</TR>
</TABLE>
<br>
<TABLE align=center border=0 borderColor=#000000 cellPadding=0
cellSpacing=0 width="99%">
<TR>
<TD
background="images/T_back.gif"
width="18%"><IMG src="images/T_1.gif" width=90 height=24 border="0"></TD>
<TD
background="images/T_back.gif"
width="77%"> <font color="#993300">获 取 登 陆 密 码</font></TD>
<TD width="5%"><IMG height=24 src="images/T_2.gif" width=29></TD>
</TR>
</TABLE>
<table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<form action="?action=save" method="post" name="reg" id="reg">
<tr bgcolor="#FFFFFF">
<td height="25" align="center">密  码:</td>
<td height="25">
<input name="password" type="type" class="input" id="password" value="<%=rs("userpassword")%>" size="50"></td>
<tr bgcolor="#FFFFFF">
<td height="25"><input name="username" type="hidden" id="username" value="<%=username%>"></td>
<td height="25"><input name="Submit" type="submit" class="button" value=" 修 改 "></td>
</tr>

</form>
</table>
<p> </p></td>
</tr>
</table>
<%
end if
rs.close
set rs=nothing

elseif action="save" then

dim password
username=checkstr(request.form("username"))
answer=checkstr(trim(request.form("answer")))

if password="" or strlength(password)>30 then
call mb("密码不能为空或大于30字长!","",0)
end if

set rs=server.createobject("adodb.recordset")
sql="select question from author where username='"&username&"'"

rs.open sql,conn,1,3

if not(rs.bof and rs.eof) then
rs("userpassword")=md5(password,"long")
rs.update
else
call mb("对不起,找不到您的帐号!","",0)
end if
rs.close
set rs=nothing
else
%>
<table width="770" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="border">
<tr>
<td width="19" valign="top" bgcolor="#F7F7F7">
<table width="96%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="22"><img src="images/left_getpwd.gif" alt="获取密码" width="190" height="34" border="0"></td>
</tr>
<tr>
<td height="22" align="center"> </td>
</tr>
<tr>
<td height="22" align="center"> → <font color="#FF0000">填写登陆帐号</font></td>
</tr>
<tr>
<td height="22" align="center">↓</td>
</tr>
<tr>
<td height="22" align="center">填写密码答案</td>
</tr>
<tr>
<td height="22" align="center">↓</td>
</tr>
<tr>
<td height="22" align="center">获取您的密码</td>
</tr>
<tr>
<td height="22"> </td>
</tr>
<tr>
<td height="22"> </td>
</tr>
</table>
</td>
<td width="1" valign="top" background="images/bg_vline.gif"></td>
<td valign="top"><TABLE align=center
background="images/line01.gif"
border=0 cellPadding=0 cellSpacing=0 height=24 width="100%">
<TR>
<TD height=21 width="63%"> <IMG height=12 src="images/A3.gif" width=12>
当前位置:<A href="index.asp">网络展示中心</A> -> 获取登陆密码 ->
填写帐号</TD>
<TD height=21 width="37%"> </TD>
</TR>
</TABLE>
<form action="?action=step2" method="post" name="getpassword" id="getpassword">
<TABLE align=center border=0 borderColor=#000000 cellPadding=0
cellSpacing=0 width="99%">
<TR>
<TD
background="images/T_back.gif"
width="18%"><IMG src="images/T_1.gif" width=90 height=24 border="0"></TD>
<TD
background="images/T_back.gif"
width="77%"> <font color="#993300">获 取 登 陆 密 码</font></TD>
<TD width="5%"><IMG height=24 src="images/T_2.gif" width=29></TD>
</TR>
</TABLE>
<table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="#FFFFFF">
<td width="34%" height="22" align="center">第一步:请输入您的帐号</td>
<td width="66%" height="22">
<input name="username" type="text" class="input" id="username" size="25"></td>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<td height="30" colspan="2">
<input name="Submit" type="submit" class="button" value=" 下一步 ">
</td>
</tr>
</table>
</form>
<p> </p>
</td>
</tr>
</table>
<%
end if
%>

</DIV>
</BODY></HTML>


------------------------------------------------------------------------
1.可以显示被md5加密后的密码.
2.在修改密码之后出现错误提示:
密码不能为空或大于30字长!(226行)
3.密码修改不成功.
----------------------------------------------------------------
说明:这是一个修复密码用的.
但是我修复不了.急..分不够可以再加..
谢谢..
xieyj 2004-01-10
  • 打赏
  • 举报
回复
代码的确长,我基本上看了一下,如果还有问题,请联系我的QQ:83537009

1.可以显示被md5加密后的密码.
只能显示出 md5 加密后的,因为这个加密算法不可逆。

2.在修改密码之后出现错误提示:
密码不能为空或大于30字长!(226行)
提交时判断:
if len(request("password"))>30 then
response.write "密码太长"
end if

3.密码修改不成功.
直接使用:conn.execute("update tab set password='"&md5(request("password"))&"' where username='"&request("username")&"'")
wsd315 2004-01-10
  • 打赏
  • 举报
回复
htm太多了
没看到头绪~~
bingofei 2004-01-10
  • 打赏
  • 举报
回复
调试程序是一种技巧。
描述错误也是一种技巧。
麻烦你把问题提炼一下,没有人愿意看这么长的代码
SEASKYLONG 2004-01-10
  • 打赏
  • 举报
回复
都说长了.那个有心情看的就看.我想你们也不怎么样.这也算长.才两百多行.气人.

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧