admin_setpass.asp
来自「eayanQuery思燕大学成绩查询系统 版本 V1.6」· ASP 代码 · 共 105 行
ASP
105 行
<%option explicit%>
<!--#include file="../Conn.asp"-->
<!--#include file="../include/PublicFunction.asp"-->
<!--#include file="../include/ReplaceHtml.asp"-->
<!--#include file="../include/md5.asp"-->
<!--#include file="../include/Session.asp"-->
<%'call CheckOuterUrl()
Dim Teacher_name
Teacher_name=HtmlEncode(request.Cookies("Teacher_name"))
'强制浏览器重新访问服务器下载页面
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
Dim Action
Action=request.QueryString("Action")
Select Case Action
Case "SavePassword"
Call SavePassword()
Case Else
Call Main()
End Select
Sub Main()
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML lang="gb2312">
<HEAD>
<title>修改密码---思燕Seayan成绩查询系统SQL版本v1.0----现代教学管理信息系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="gb2312">
<meta content="all" name="robots">
<meta content="websvc@163.com" name="author">
<meta content="版权所有:Seagreen 2005-2008" name="Copyright">
<meta content="思燕Seayan成绩查询系统SQL版本v1.0, 由 赵海 先生模仿方正教务管理系统开发。" name="description">
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="stylesheet" rev="stylesheet" href="../images/main.css" type="text/css" media="all">
</HEAD>
<BODY background="../axhucj/images/admin_MainBg.gif">
<script language="javascript" type="text/javascript">
function CheckForm(ObjForm) {
if(ObjForm.Password.value == '') {
alert('请输入授权密码!');
ObjForm.Password.focus();
return false;
}
if(ObjForm.ReapPassword.value == '') {
alert('请输入重复密码!');
ObjForm.ReapPassword.focus();
return false;
}
if(ObjForm.ReapPassword.value != ObjForm.Password.value) {
alert('两次密码输入不一致,请检查!');
ObjForm.Password.focus();
return false;
}
if (ObjForm.Password.value.length<6)
{
alert('授权密码不能少于六位!');
ObjForm.Password.focus();
return false;
}
}
</script>
<p> </p>
<form name="Form1" method="post" action="admin_setPass.asp?action=SavePassword" onsubmit="return CheckForm(this)">
<font color="red"></font>后台管理员修改密码
<p>输入密码:
<input type="Password" name="Password" />
</p>
<p>重复密码:
<input type="Password" name="ReapPassword" />
</p>
<p>
<input type="submit" name="Submit" value="提交" /> <input type="reset" name="Submit" value="取消" />
</p>
</form>
</BODY>
</HTML>
<%
End sub
'保存密码的过程调用*******************************
Sub SavePassword()
Dim Password,ReapPassword,SavePasswordSql,pwd
IF request.Form("ReapPassword") = "" or request.Form("Password")="" then
Response.Write("<script>alert('密码或者重复密码不能为空,请返回检查!');history.go(-1);</script>")
response.End()
END if
IF request.Form("ReapPassword") <> request.Form("Password") then
Response.Write("<script>alert('两次密码输入不一致,请返回检查!');history.go(-1);</script>")
response.End()
END if
Password=md5(request.Form("Password"))
pwd=md5(request.Form("Password"))
SavePasswordSql="Update [admin] set [admin_pass]='"&Password&"' where [admin_id]='1'"
Initialize_Conn.execute(SavePasswordSql)
Response.Write("<script>alert('密码修改成功,请您妥善保管。');</script>")
Response.Cookies("Password")=""
Response.Cookies("Password")=Password
Response.Cookies("AdminPass")= pwd
Response.Write("<script>location.href='admin_setPass.asp';</script>")
End Sub
%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?