<!-- #include file="conn.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>找回密码</title>
</head>
<center>
<body>
<% if strcomp(request.QueryString("getp"),"n0")=0 then %>
<form name="form1" method="post" action="getpassword.asp?getp=n1">
<table width="54%" border="0">
<tr>
<td width="44%">第一步,输入用户名:</td>
<td width="56%"><input name="username" type="text" id="username"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="提交"></td>
</tr>
</table>
</form>
<% end if
set rs=server.createobject("adodb.recordset")
sql="select * from reg where username='"&request.form("username")&"'"
rs.open sql,conn,1,1
if strcomp(request.QueryString("getp"),"n1")=0 then %>
<form name="form1" method="post" action="getpassword.asp?getp=n2">
<table width="56%" border="0">
<tr>
<td colspan="2">问题:<%=rs("quest")%></td>
</tr>
<tr>
<td width="42%">第二步,输入答案:</td>
<td width="58%"><input name="username" type="text" size="35"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="提交"></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</form>
<% end if
set rsd=server.createobject("adodb.recordset")
sqld="select * from reg where getpassword='"&request.form("username")&"'"
rsd.open sqld,conn,1,1
if strcomp(request.QueryString("getp"),"n2")=0 then %>
<form name="form1" method="post" action="getpassword.asp?getp=n3">
<table width="56%" border="0">
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td width="42%">第三步,密码是:<%
response.Write(rsd("password"))
%></td>
<td width="58%"><a href="index.asp">返回登录页面</a></td>
</tr>
</table>
</form>
<% end if %>
</body>
</center>
</html>
以上是代码,但如果问题回答错了要怎么处理啊?
我是菜鸟,请高手帮帮我,谢谢。