| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 391 人关注过本帖
标题:[求助]关于“取回密码”问题?
只看楼主 加入收藏
一个人去漫步
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2006-5-29
收藏
 问题点数:0 回复次数:1 
[求助]关于“取回密码”问题?


<!-- #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>

以上是代码,但如果问题回答错了要怎么处理啊?
我是菜鸟,请高手帮帮我,谢谢。

搜索更多相关主题的帖子: 取回密码 
2006-05-29 10:27
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
回复:(一个人去漫步)[求助]关于“取回密码”问题?...
以下是引用一个人去漫步在2006-5-29 10:27:00的发言:


<!-- #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>

以上是代码,但如果问题回答错了要怎么处理啊?
我是菜鸟,请高手帮帮我,谢谢。

问题回答错了,可以给出提示提示用户问题回答错误,或者直接返回登陆页面让用户从新登陆。

2006-05-29 11:02
快速回复:[求助]关于“取回密码”问题?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014490 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved