index_getpwd.asp

来自「本人的课程设计。不足之处请大家指教。因为第一次用ASP有很多不足的地方。」· ASP 代码 · 共 99 行

ASP
99
字号
<!-- #include file="conn/conn.asp" -->
<html>
<script language="javascript">
function check(){ 
        if(document.f_zc.id.value=="")
		{//判断用户是否输入用户名 
			alert("请输入用户名!")
			document.f_zc.id.focus()
			return
		} 
//		if(document.f_zc.question.value=="")
//		{//判断用户是否输入姓名
	//		alert("请输入问题!")
	//		document.f_zc.question.focus()
		//	return 
		//} 
		//if(document.f_zc.answer.value=="")
		//{//判断用户是否输入密码 
	//		alert("请输入问题答案!")
		//	document.f_zc.answer.focus()
	//		return
//		} 

      document.f_zc.submit()
  }
</script>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>忘记密码</title>
</head>
<body bgcolor="#0099FF">
	<p><H1 align="center">找回密码</H1></p>
	 <form method="POST" name="f_zc" action="">

	<table align="center" width="55%">
	<tr><td><p><font color="red">请填写用户名</font></p></td></tr>
	<tr><td><input type="text" name="id" size="20"></p></td></tr>
	<tr><td><p><font color="red">请填写问题</font></p></td></tr>
	<tr><td><p><input type="text" name="question" size="40">(如:您的生日)</p></td></tr>
	<tr><td><p><font color="red">请填写答案</font></p></td></tr>
	<tr><td><p><input type="text" name="answer" size="40">(如:19800101)</p></td></tr>
	</table>	
	<p align="center">
	<input type="submit" value="确认" name="ok" onclick="check()">
	<input type="reset"  value="重写" name="cancel">
	</p>
	
	</form>

<%
id=trim(request.form("id"))	
question=trim(request.form("question"))	
answer=trim(request.form("answer"))	
   if id="" then
   %><font color="#993300">&nbsp;&nbsp;&nbsp;&nbsp;
   							&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;
							<%response.write "请填写密码信息"%></font><%
   else

	set rs=server.createobject("adodb.recordset")
	sql="select * from student where id='"&id&"' and question='"&question&"' and answer='"&answer&"'"
	rs.open sql,conn,1,1
	if rs.eof then
	%><font color="#993300">&nbsp;&nbsp;&nbsp;&nbsp;
   							&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;
	 <%response.Write "<tr><td>输入信息错误,请重新填写!</tr></td>"%></font><%
	else
	response.cookies("username")=trim(request.form("id"))
%>
	<table width="55%" align="center" bordercolor="#FFCCFF">
	<tr><td><p><font color="blue">用户ID:<font color="#FF0000"><%=trim(rs("id"))%></font></font></p></td></tr>
	<tr><td><p><font color="blue">您的密码是:<font color="#FF0000"><%=trim(rs("pwd"))%></font></font></p></td></tr>
	<tr><td>请保管好您的密码信息!	</td></tr>
	<tr><td>如果要修改密码或个人信息,请<a href="stud_edit1.asp?id=<%=trim(rs("id"))%>">点击这里</a>
	</td></tr>
</table>
        <%
	end if
	end if
%>
      
	<div align="center">
	  <p>&nbsp;</p>
	  <p><a href="index.asp"><font color="#FF0000">[返回]</font></a>

      </p>
</div>
</body>

</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?