📄 getpass.asp
字号:
<!--#include file="top.asp"-->
<!--#include file="inc/char.inc"-->
<!--#include file="inc/md5.asp"-->
<%
dim action
action=request("action")
if action="step2" then
dim username,email
username=htmlencode2(request.form("username"))
email=htmlencode2(request.form("email"))
if username="" or email="" then
call mb("用户名或E-mail均不能为空!","",0)
end if
set rs=server.createobject("adodb.recordset")
sql="select * from [user] where username='"&username&"' and email='"&email&"' and state=1"
rs.open sql,conn,1,1
if rs.bof and rs.eof then
call mb("对不起,发生错误:\n\n1.用户名或E-mail错误\n\n2.用户帐号还未开通或被锁定!","",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 width="190" height="22"> </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 width="63%"> <img height="12" src="images/arrow.gif" width="12"> 当前位置:<a href="index.asp" title="首页"><%=site%></a>
-> 获取用户密码</td>
<td width="37%"> </td>
</tr>
</table>
<br>
<table align="center" border="0" bordercolor="#000000" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td background="images/bar_bg.gif" width="18%"><img src="images/bar_left.gif" width="29" height="24" border="0"></td>
<td background="images/bar_bg.gif" width="79%"><font color="#993300">第二步:回答问题</font></td>
<td width="4%"><img src="images/bar_right.gif" width="20" height="25" border="0"></td>
</tr>
</table>
<table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<form action="?action=step3" method="post" name="getpassword" id="getpassword">
<tr bgcolor="#FFFFFF">
<td width="23%" height="25" align="center">密码问题:</td>
<td width="77%" height="25"><b><%=rs("question")%></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></form>
</table>
</td>
</tr>
</table>
<%
end if
rs.close
set rs=nothing
elseif action="step3" then
dim answer
username=htmlencode2(request.form("username"))
answer=htmlencode2(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 * from [user] where username='"&username&"'")
if rs.bof and rs.eof then
call mb("对不起,找不到此用户名!","getpassword.asp","")
elseif rs("answer")<>md5(answer) then
call mb("对不起,密码答案不正确!","",0)
else
randomize
newpassword=left(rnd*10000000000,8)
set rsn=server.createobject("adodb.recordset")
sqln="select * from [user] where username='"&username&"'"
rsn.open sqln,conn,1,3
rsn("password")=md5(newpassword)
rsn.update
rsn.close
%>
<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="96%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="22"> </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 width="63%"> <img height="12" src="images/arrow.gif" width="12"> 当前位置:<a href="index.asp" title="首页"><%=site%></a> -> 获取用户密码</td>
<td height="21" width="37%"> </td>
</tr>
</table>
<br>
<table align="center" border="0" bordercolor="#000000" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td background="images/bar_bg.gif" width="18%"><img border="0" src="images/bar_left.gif"></td>
<td background="images/bar_bg.gif" width="79%"><font color="#993300">第三步:重设新密码</font></td>
<td width="4%"><img border="0" src="images/bar_right.gif"></td>
</tr>
</table>
<table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td height="91" colspan="2" bgcolor="#FFFFFF"> 您好,系统已经将您的密码重设为:<font color="red"><b><%=newpassword%></b></font>,请立即使用新的密码[<a
href="login.asp">登录</a>]并重新修改!</td>
</tr>
</table>
</td>
</tr>
</table>
<%
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="190" valign="top" bgcolor="#F7F7F7">
<table width="96%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="22"> </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 width="63%"> <img height="12" src="images/arrow.gif" width="12"> 当前位置:<a href="index.asp" title="首页"><%=site%></a>-> 获取用户密码</td>
<td width="37%"> </td>
</tr>
</table>
<br>
<table align="center" border="0" bordercolor="#000000" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td background="images/bar_bg.gif" width="18%"><img border="0" src="images/bar_left.gif"></td>
<td background="images/bar_bg.gif" width="79%"><font color="#993300">第一步:请输入您的用户名和E-mail:</font></td>
<td width="4%"><img border="0" src="images/bar_right.gif"></td>
</tr>
</table>
<table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<form action="?action=step2" method="post" name="getpassword" id="getpassword">
<tr bgcolor="#FFFFFF">
<td height="22" align="right" bgcolor="#FFFFFF">用户名:</td>
<td height="22"><input name="username" type="text" class="input" id="username" size="18">
*</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="34%" height="22" align="right" bgcolor="#FFFFFF">E-mail:</td>
<td width="66%" height="22"><input name="email" type="text" class="input"size="25">
*</td>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<td height="30" colspan="2"><input name="Submit" type="submit" class="button" value=" 下一步 "></td>
</tr></form>
</table>
</td>
</tr>
</table>
<%
end if
%>
<!--#include file="copyright.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -