📄 recoverpasswd.asp
字号:
<!-- #include file="setup.asp" -->
<!-- #include file="inc/MD5.asp" --><%
top
username=HTMLEncode(Request("username"))
userpass=Trim(Request("userpass"))
if username<>"" then
sql="select * from [user] where username='"&HTMLEncode(username)&"'"
rs.Open sql,Conn,1
if rs.eof then error2(""&username&"的用户资料不存在")
birthday=rs("birthday")
answer=rs("answer")
question=rs("question")
rs.close
end if
select case Request("menu")
case ""
index
case "rejigger"
rejigger
case "rejiggerok"
rejiggerok
end select
sub rejiggerok
if Request("username")="" then error("<li>用户名称没有填写")
if ""&birthday&""="" then error("<li>您注册的时候没有填写出生日期,所以无法通过此功能找回密码")
if Request("birthday")<>birthday then error("<li>出生日期填写错误")
if ""&answer&""="" or ""&question&""="" then error2("您注册的时候没有填写密码提示问题或者密码提示答案,所以无法通过此功能找回密码")
if md5(Request("answer"))<>answer then error2("答案错误")
if Request("userpass")="" then error2("请输入新的密码")
if Request("userpass")<>Request("userpass2") then error2("您2次输入的密码不同")
conn.execute("update [user] set userpass='"&md5(userpass)&"' where username='"&username&"'")
message=message&"<li>更改密码成功<li><a href=Default.asp>返回论坛首页</a>"
succeed(""&message&"<meta http-equiv=refresh content=3;url=Default.asp>")
end sub
sub rejigger
if Request("username")="" then error("<li>用户名称没有填写")
if ""&birthday&""="" then error("<li>您注册的时候没有填写出生日期,所以无法通过此功能找回密码")
if Request("birthday")<>birthday then error("<li>出生日期填写错误")
%>
<table border="0" width="97%" align="center" cellspacing="1" cellpadding="4" class="a2">
<tr class="a3">
<td height="25"> <img src="images/Forum_nav.gif"> <%ClubTree%>
→ 更改密码</td>
</tr>
</table>
<br>
<table width="333" border="0" cellspacing="1" cellpadding="2" align="center" class="a2">
<form method="POST" action="RecoverPasswd.asp?menu=rejiggerok">
<input type="hidden" name="username" value="<%=Request("username")%>">
<input type="hidden" name="birthyear" value="<%=Request("birthyear")%>">
<input type="hidden" name="birthmonth" value="<%=Request("birthmonth")%>">
<input type="hidden" name="birthday" value="<%=Request("birthday")%>">
<tr>
<td width="100%" align="center" height="20" class="a1" colspan="2">更改密码</td>
</tr>
<tr class="a3">
<td width="50%" align="right" height="25">请回答问题:</td>
<td width="50%" height="25"><%=question%></td>
</tr>
<tr class="a4">
<td width="50%" align="right" height="20">答案:</td>
<td width="50%" height="20"><input size="15" value name="answer"></td>
</tr>
<tr class="a3">
<td width="50%" align="right" height="20">请输入新的密码:</td>
<td width="50%" height="20">
<input type="password" size="15" name="userpass"></td>
</tr>
<tr class="a4">
<td width="50%" align="right" height="20">请再次输入密码:</td>
<td width="50%" height="20">
<input type="password" size="15" name="userpass2"></td>
</tr>
<tr>
<td width="100%" align="center" height="20" colspan="2" bgcolor="FFFFFF">
<input type="submit" value=" 确定 " name="Submit1"> <input type="reset" value=" 取消 " name="Submit"></td>
</tr>
</form>
</table>
<br>
<center><a href="javascript:history.back()">BACK </a><br>
<%
end sub
sub index
%>
<script src="inc/birthday.js"></script>
<table border="0" width="97%" align="center" cellspacing="1" cellpadding="4" class="a2">
<tr class="a3">
<td height="25"> <img src="images/Forum_nav.gif"> <%ClubTree%>
→ 忘记密码</td>
</tr>
</table>
<br>
<br>
<form action="RecoverPasswd.asp?menu=rejigger" method="post">
<table width="333" border="0" cellspacing="1" cellpadding="2" align="center" class="a2">
<tr>
<td width="328" class="a1" height="20">
<div align="center">
忘记密码</div>
</td>
</tr>
<tr>
<td height="19" width="328" valign="top" class="a3">
<div align="center">
用户名称:<input size="25" name="username" value="<%=Request.Cookies("username")%>"></div>
<div align="center">
出生日期:<input onfocus="show_cele_date(birthday,'','',birthday)" name="birthday" size="25"><br>
<input type="submit" value=" 确定 " name="Submit1"> <input type="reset" value=" 取消 " name="Submit">
</div>
</td>
</tr>
</table>
</form>
<center><a href="javascript:history.back()">BACK </a><br>
<%
end sub
htmlend
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -