📄 getpasswd.asp
字号:
<%response.expires=0%>
<!--#include file="conn.asp"-->
<!-- #include file="const.asp" -->
<!--#include file="char.asp"-->
<html><head>
<meta NAME=GENERATOR Content="Microsoft FrontPage 4.0" CHARSET=GB2312>
<title><%=SchoolmateName%>——取回密码</title>
<link rel=stylesheet type=text/css href=txl.css>
</head>
<body alink=#333333 vlink=#333333 link=#333333 topmargin=0>
<%
if request("action")="getpass" then
call getpass()
elseif request("action")="answer" then
call showquestion()
else
call showuserform()
end if
call endconnection()
sub showuserform()
%>
<br><br><form action="getpasswd.asp" method="post">
<input type=hidden name=action value=answer>
<table cellpadding=0 cellspacing=0 border=0 width=80% bgcolor=<%=TableborderColor%> align=center>
<tr>
<td>
<table cellpadding=6 cellspacing=1 border=0 width=100%>
<tr>
<td bgcolor=<%=TableTitleColor%> valign=middle colspan=2 align=center>
<b>取回密码</b>(第一步:用户名)</font></td></tr>
<tr>
<td bgcolor=<%=TablebodyColor2%> valign=middle width=40% height=40> 请输入您在同学录注册时的用户名:</td>
<td bgcolor=<%=TablebodyColor1%> valign=middle> <INPUT name=username type=text size=30> </td></tr>
<tr>
<td bgcolor=<%=TableTitleColor%> valign=middle colspan=2 align=center><input type=submit name="submit" value="提交"></td></tr></table></td></tr></table>
</form>
<%
end sub
sub showquestion()
username=trim(request("username"))
if username="" then
Errmsg=Errmsg+"<br>"+"<li>请确认输入您的用户名。"
founderr=true
else
sql="select userid,question from [student] where userid='"&htmlencode(username)&"'"
set rs=conn.execute(sql)
if rs.eof then
Errmsg=Errmsg+"<br>"+"<li>该用户名并没有在同学录注册,请确认输入是否正确。"
founderr=true
elseif rs("question")="" or isnull(rs("question")) then
Errmsg=Errmsg+"<br>"+"<li>操作失败!你注册时没有填写取回密码时所需要的信息。"
founderr=true
end if
end if
if founderr=true then
call error(Errmsg)
exit sub
end if
%>
<br><br><form action="getpasswd.asp" method="post">
<input type=hidden name=action value=getpass>
<input type=hidden name=username value=<%=username%>>
<table cellpadding=0 cellspacing=0 border=0 width=80% bgcolor=<%=TableborderColor%> align=center>
<tr>
<td>
<table cellpadding=6 cellspacing=1 border=0 width=100%>
<tr bgcolor=<%=TableTitleColor%>>
<td valign=middle colspan=2 align=center>
<b>取回密码</b>(第二步:回答问题)</font></td></tr>
<tr bgcolor=<%=TablebodyColor2%>>
<td valign=middle width=40%>
<b>密码提示问题:</b></td><td> <%=htmlencode(rs("question"))%></td></tr>
<tr bgcolor=<%=TablebodyColor2%>><td> <b>取回密码答案:</b></td><td> <INPUT name=answer type=text size=30> </td></tr>
<tr bgcolor=<%=TablebodyColor2%>><td colspan=2> <b>说明:</b>请填写您正确的问题答案。</td></tr>
<tr>
<td bgcolor=<%=TableTitleColor%> valign=middle colspan=2 align=center><input type=submit name="submit" value="提交"></td></tr></table></td></tr></table>
</form>
<%
end sub
sub getpass()
answer=trim(request("answer"))
username=request("username")
if answer="" then
Errmsg=Errmsg+"<br>"+"<li>请确认输入了问题答案。"
founderr=true
else
sql="select answer,userpwd from [student] where userid='"&htmlencode(username)&"'"
set rs=conn.execute(sql)
if rs("answer")<>answer then
Errmsg=Errmsg+"<br>"+"<li>操作失败!你的问题回答得不正确。"
founderr=true
end if
end if
if founderr=true then
call error(Errmsg)
exit sub
end if
%>
<br><br><form action=login.asp><table cellpadding=0 cellspacing=0 border=0 width=80% bgcolor=<%=Tablebordercolor%> align=center>
<tr>
<td>
<table cellpadding=6 cellspacing=1 border=0 width=100%>
<tr align="center">
<td width="100%" colspan=2 bgcolor=<%=Tabletitlecolor%>><b>取回密码</b>(成功取回)</td>
</tr>
<tr>
<td width="100%" colspan=2 bgcolor=<%=Tablebodycolor2%>> 恭喜您,您成功取回密码!</b>
</td></tr>
<tr bgcolor=<%=Tablebodycolor2%>><td width=40%> <b>用户名:</b></td><td><font color=blue> <%=htmlencode(username)%></font></td></tr>
<tr bgcolor=<%=Tablebodycolor2%>><td> <b>密  码:</b></td><td><font color=blue> <%=htmlencode(rs("userpwd"))%></font>
</td>
</tr>
<tr bgcolor=<%=Tablebodycolor2%>><td colspan=2> <b>说 明:</b>请妥善保管您的密码!</td></tr>
<tr align="center">
<td width="100%" bgcolor=<%=Tabletitlecolor%> colspan=2>
<input type=submit name=login value=登陆>
</td>
</tr>
</table> </td></tr></table>
<%
end sub
%>
<!--#include file="footer.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -