?? getpasswd.asp
字號:
<%@LANGUAGE="VBScript" CODEPAGE="936"%>
<!--#include file="conn.asp" -->
<!--#include file="md5.asp" -->
<%
usr=replace(trim(request.Form("text1")),"'","")
if len(usr)>0 then
errmsg="<li>請輸入問題答案。"
strsql="select * from [user] where username='"&usr&"'"
set rs=conn.execute(strsql)
if rs.bof or rs.eof then
response.Redirect("lostpasswd.asp?errmsg=<li>該班級成員不存在!")
response.End
end if
username=rs("username")
answer=rs("answer")
rs.close
set rs=nothing
end if
if request("method")="submit" then
errmsg=""
question=replace(trim(request.Form("question")),"'","")
question=md5(question)
id=request.Form("id")
strsql="select username,passwd,question from [user] where username='"&id&"' and question='"&question&"'"
set rs2=server.CreateObject("adodb.recordset")
rs2.open strsql,conn,1,3
if rs2.bof or rs2.eof then
response.Redirect("lostpasswd.asp?errmsg=<li>您輸入的答案不正確!")
else
dim rndnum
Randomize
Do While Len(rndnum)<6
num1=CStr(Chr((57-48)*rnd+48))
rndnum=rndnum&num1
loop
rs2("passwd")=md5(rndnum)
rs2.update
rs2.close
msg="您的新密碼是<font color='#FF0000'>"&rndnum&"</font>,建議您盡快更新您的密碼"
end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<title><%=classname%>同學(xué)錄</title>
<link href="css/class.css" type=text/css rel=stylesheet>
<script language="JavaScript">
<!--
function checkform(){
if (form1.text1.value ==""){
alert("請輸寫答案!");
form1.text1.focus();
return false;}
return true
}
//-->
</script>
</head>
<body background="images/1.GIF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="776" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"><img src="images/top_t.gif" width="776" height="43"></td>
</tr>
<tr>
<td width="138"><img src="images/top_l.gif" width="138" height="39"></td>
<td width="584" align="right" bgcolor="#666B52"><img src="images/toplogo.gif" width="200" height="39"></td>
<td width="54"><img src="images/top_r.gif" width="54" height="39"></td>
</tr>
<tr>
<td colspan="3"><table width="776" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="120" rowspan="2" valign="top" background="images/left_x.gif"><img src="images/left_img.gif" width="120" height="480"></td>
<td rowspan="2" valign="top" bgcolor="#F2F2EA"> <div align="center">
<!--#include file="top.asp" -->
</div>
<table width="618" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"> <div align="center"><br>
<!--#include file="left.asp" -->
</div></td>
<td width="10"> </td>
<td width="418" valign="top"><table width="400" border="0" align="center" cellpadding="1" cellspacing="3" class="font1">
<tr>
<td width="459">您的位置>找回密碼</td>
<td width="27"> </td>
</tr>
</table>
<div align="center">
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="400" border="0" cellpadding="0" cellspacing="0" background="images/gnymtbz.gif">
<tr>
<td width="135"><img src="images/zhmm.gif" width="135" height="36"></td>
<td> </td>
<td width="100"><img src="images/gnymtyb.gif" width="100" height="36"></td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="400" border="0" cellpadding="0" cellspacing="0" background="images/n_bk.gif">
<tr>
<td><form name="form1" method="post" action="getpasswd.asp" onSubmit="return checkform()">
<table width="100%" border="0" cellpadding="5" cellspacing="1" class="font1">
<tr>
<td width="377"><div align="center"></div>
<%=errmsg%></td>
</tr>
<tr>
<td align="center"> <table width="380" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#666B52">
<tr>
<td><table width="100%" border="0" cellpadding="2" cellspacing="1">
<tr bgcolor="#FFFFFF">
<td width="30%" align="center" bgcolor="E3E3CF"><strong>密碼提示問題:</strong></td>
<td width="70%" bgcolor="#f1f1eb">
<input name="answer" type="text" class="input-box" id="answer" value="<%=answer%>" height="20">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="center" bgcolor="E3E3CF"><strong>找回密碼答案:</strong></td>
<td bgcolor="#f1f1eb"><input name="question" type="text" class="input-box" id="question" height="20"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td><div align="center">
<input name="method" type="hidden" id="method" value="submit">
<input name="id" type="hidden" id="id" value="<%=username%>">
<input type="submit" name="Submit" value="提交">
<br>
</div></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td><div align="center"><%=msg%></div></td>
</tr>
</table></td>
</tr>
<tr>
<td><img src="images/n_foot.gif" width="400" height="10"></td>
</tr>
</table>
</div></td>
</tr>
</table></td>
<td width="38" valign="top" background="images/right_b.gif"><img src="images/right_b.gif" width="38" height="5"></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3"><img src="images/z_f.gif" width="776" height="26"></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table>
<div align="center"></div>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -