[求助]ASP找回密码程序
有谁能帮我用ASP写下,用户找回密码程序?
找回密码的界面
<form method="POST" action="findpas.asp">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
<tr>
<td width="17%">用户:</td>
<td width="16%"><input type="text" name="username" size="20"> </td>
<td width="17%">问题:</td>
<td width="16%"><input type="text" name="question" size="20"> </td>
<td width="17%">答案:</td>
<td width="17%"><input type="text" name="answer" size="20"> </td>
</tr>
<tr>
<td width="100%" colspan="6"> <input type="submit" value="提交" name="B1"><input type="reset" value="重置" name="B2"></p> </td>
</tr>
</table>
</form>
findpas.asp 的代码
<% username=request.form("username")
question=request.form("question")
answer=request.form("answer")
if username="" or isnull(username) or question="" or isnull(question) or answer="" or isnull(answer) then
session("err_msg")="<li><br>您输入输入的用户名、问题和答案不能为空!"
response.redirect "error.asp"
end if
set conn=server.createobject("adodb.connection")
DBPath = Server.MapPath("数据库")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
set findpas=server.createobject("adodb.recordset")
sql="select * from 用户表 where username='"&username&"' and question='"&question&"' and answer='"&answer&"'"
findpas.open sql,conn,1,1
if not findpas.eof then
response.write "您的口令是:"&findpas("口令的字段")
end if
findpas.close
set conn=nothing
%>
至于 error.asp 是什么代码 那时你自己的了