changepw.asp

来自「家教信息管理系统的程序代码」· ASP 代码 · 共 57 行

ASP
57
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
function checkpw()
{
	if(myform.new1.value!=myform.new2.value)
	{
	alert("两次输入的密码不等!");
	return false;
	}
	return true;
}
</script>
<style type="text/css">
<!--
body,td,th {
	font-size: 14px;
	color: #003399;
}
-->
</style>
</head>
<body>
<p>
<form method="post" onSubmit="return checkpw();" name="myform">
<table width="70%"  border="0" align="center">
  <tr>
    <td>新密码:</td>
    <td><input type="password" name="new1" size=20></td>
  </tr>
  <tr>
    <td>确认密码:</td>
    <td><input type="password" name="new2" size=20></td>
  </tr>
  <tr>
    <td><input type="submit" name="st" value="提交"></td>
    <td><input type="reset"  value="重置"></td>
  </tr>
</table>
</form>
</body>
</html>
<%
	if Request.Form("st")<>"" then
	nick=session("student")
	new1=Request.Form("new1")
	Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open "Dbq=" & Server.Mappath("../db/info.mdb") & ";Driver={Microsoft Access Driver (*.mdb)}"
	strSql="update studentreg set spass='" & new1 & "' where snick='" & nick & "'"
	conn.Execute(strSql)
	Response.Write("密码修改成功")
	End If
	
%>

⌨️ 快捷键说明

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