⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 recoverpasswd.asp

📁 感谢您使用BBSXP
💻 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 [BBSXP_Users] where UserName='"&HTMLEncode(UserName)&"'"
Rs.Open sql,Conn,1
if Rs.eof then error2(""&UserName&"的用户资料不存在")
birthday=Rs("birthday")
PasswordAnswer=Rs("PasswordAnswer")
PasswordQuestion=Rs("PasswordQuestion")
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 ""&PasswordAnswer&""="" or ""&PasswordQuestion&""="" then error2("您注册的时候没有填写密码提示问题或者密码提示答案,所以无法通过此功能找回密码")
if md5(Request("PasswordAnswer"))<>PasswordAnswer then error2("答案错误")
if Request("Userpass")="" then error2("请输入新的密码")
if Request("Userpass")<>Request("Userpass2") then error2("您2次输入的密码不同")

Conn.execute("update [BBSXP_Users] 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="100%" align="center" cellspacing="1" cellpadding="4" class="a2">
	<tr class="a3">
		<td height="25">&nbsp;<img src="images/Forum_nav.gif">&nbsp; <%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"><%=PasswordQuestion%></td>
		</tr>
		<tr class="a4">
			<td width="50%" align="right" height="20">答案:</td>
			<td width="50%" height="20"><input size="15" value name="PasswordAnswer"></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=" 确定 "> <input type="reset" value=" 取消 "></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="100%" align="center" cellspacing="1" cellpadding="4" class="a2">
	<tr class="a3">
		<td height="25">&nbsp;<img src="images/Forum_nav.gif">&nbsp; <%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=" 确定 "> <input type="reset" value=" 取消 ">
			</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 + -