⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pw.asp

📁 轩圆学生信息管理系统[高中版] 程序功能:添加链接、修改链接、删除链接、清空链接、管理链接等
💻 ASP
字号:
<!--#include file="Inc/oConn.asp"-->
<!--#include file="Inc/Info.asp"-->
<!--#include file="Inc/Public.asp"-->
<!--#include file="Inc/md5.asp"-->
<%
On Error Resume Next 
Call CheckAdmin(",1,2,3,4,5,",","&Session("JB")&",")
Call PHead("修改密码")
Dim lg
lg = RQuery("action")
If lg&""<>"" Then
	lg = UCase(lg)
	If lg = "EDIT" Then
		Call EditSave()
	End If 
End If 
Call mainFace()
Call PFoot()
If Err Then
	Call ShowErrs()
End If 

Sub mainFace()
	Print "<div align='center'>"
	Print "<div class='lface'>"
	Print "<div class='thetitle' style='text-align:left;'>修改登录密码</div>"
	Print "<hr size='1' color='#b8b8b8'/>"
	Print "<form method='post' action='?action=edit' onsubmit='return checkF();'>"
	Print "原密码:<input type='password' name='old_mm' style='width:150px;height:20px;'>"
	Print "<br /><br />"
	Print "新密码:<input type='password' name='new_mm' style='width:150px;height:20px;'>"
	Print "<br /><br />"
	Print "确&nbsp;&nbsp;认:<input type='password' name='cnf_mm' style='width:150px;height:20px;'>"
	Print "<br /><br /><hr size='1' color='#b8b8b8'/>"
	Print "<input type='submit' value='修改密码'> <input type='reset' value='重新填写'>"
	Print "</form>"
	Print "<div align='left' class='footcopy'>&copy;2007 XMSky</div>"
	Print "</div>"
	Print "</div>"
	%>
	<script language="javascript">
function checkF()
{
	if (document.forms[0].old_mm.value=="")
	{
		window.alert('请输入原密码!');
		document.forms[0].old_mm.focus();
		return false;
	}
	if (document.forms[0].new_mm.value=="")
	{
		window.alert('请输入新密码!');
		document.forms[0].new_mm.focus();
		return false;
	}
	if (document.forms[0].cnf_mm.value=="")
	{
		window.alert('请输入确认新密码!');
		document.forms[0].cnf_mm.focus();
		return false;
	}
	if (document.forms[0].new_mm.value!=document.forms[0].cnf_mm.value)
	{
		window.alert('两次输入的新密码不同!');
		document.forms[0].new_mm.focus();
		document.forms[0].new_mm.value="";
		document.forms[0].cnf_mm.value="";
		return false;
	}
}
</script>
	<%
End Sub 

Sub EditSave()
	Dim Old_MM,New_MM,Cnf_MM,objRs,strSQL

	Old_MM = FQuery("Old_MM")
	New_MM = FQuery("New_MM")
	Cnf_MM = FQuery("Cnf_MM")

	If New_MM=Old_MM Then
		Call CloseConn()
		Call JavaScript("alert('你的新密码和老密码相同,不用进行更改!!');location.href='?';")
		Exit Sub 
	End If 

	If New_MM<>Cnf_MM Then
		Call CloseConn()
		Call JavaScript("alert('两次输入的新密码不同,请重新输入!!');location.href='?';")
		Exit Sub 
	End If 

	Old_MM = Md5(Old_MM,16)
	New_MM = MD5(New_MM,16)

	strSQL = "Select 密码 from tTable Where 姓名='"&Session("XM")&"' And 级别="&Session("JB")&""
	Set objRs = Server.CreateObject("adodb.Recordset")
	objRs.Open strSQL,oConn,2,3
	If Not objRs.Eof Then
		If objRs(0) <> Old_MM Then
			'密码不正确
			objRs.Close()
			Set objRs = Nothing 
			Call CloseConn()
			Call JavaScript("alert('旧密码输入错误,请重新输入!!');location.href='?';")
			Exit Sub 
		Else
			objRs(0).value = New_MM
			objRs.Update
			Call SaveLog(Session("XM"),"修改密码","修改密码成功")
			Call JavaScript("alert('密码修改成功!!')")
		End If 
	Else
		'帐号不存在
		objRs.Close
		Set objRs = Nothing 
		Call CloseConn()
		Call JavaScript("alert('发生未知错误!!');location.href='?';")
		Exit Sub 
	End If 
	Set objRs = Nothing 
	Call CloseConn
End Sub
%>

⌨️ 快捷键说明

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