📄 lg.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 PHead(SiteName)
Dim lg
lg = RQuery("action")
If lg&""<>"" Then
lg = UCase(lg)
If lg = "LOGIN" Then
Call loging()
ElseIf lg = "LOGOUT" Then
Call logout()
End If
End If
Call mainFace()
Call PFoot()
If Err Then
Call ShowErrs()
End If
Sub mainFace()
Print "<div class='lface' style='text-align:center;width:400px'>"
Print "<div class='thetitle' style='text-align:left;'>系统登录</div>"
Print "<hr size='1' color='#b8b8b8'/>"
Print "<form method=post action='?action=login' onsubmit='return checkF();'>"
Print "登录帐号:<input type='text' name='zh' value='' style='width:150px;'>"
Print "<br /><br />"
Print "登录密码:<input type='password' name='mm' value='' style='width:150px;'>"
Print "<br /><br /><hr size='1' color='#b8b8b8'/>"
Print "<input type='submit' value='用户登录'> <input type='reset' value='重新填写'>"
Print " <input type='button' value='取消登录' onclick='top.window.close()'>"
Print "</form>"
Print "<div align='left' class='footcopy'>©2007 XMSky</div>"
Print "</div>"
%>
<script language="javascript">
function checkF()
{
if (document.forms[0].zh.value=="")
{
window.alert('请输入登录帐号!');
document.forms[0].zh.focus();
return false;
}
if (document.forms[0].mm.value=="")
{
window.alert('请输入登录密码!');
document.forms[0].mm.focus();
return false;
}
}
document.forms[0].zh.focus();
</script>
<%
End Sub
Sub loging()
Dim ZH,MM,objRs
ZH = FQuery("ZH")
MM = FQuery("MM")
Set objRs = oConn.Execute("Select tID,姓名,班级,密码,级别,部门,职务 From tTable Where 帐号='"&ZH&"'")
If Not objRs.Eof Then
If objRs(3) <> MD5(MM,16) Then
'密码不正确
Call SaveLog(objRs(1),"系统登录","密码错误")
Set objRs = Nothing
Call CloseConn()
Call JavaScript("alert('密码错误,请重试!!');location.href='?';")
Exit Sub
Else
Session("XM") = objRs(1)
Session("BJ") = objRs(2)
Session("JB") = objRs(4)
Session("BM") = objRs(5)
Session("ZW") = objRs(6)
Session("LG") = 1
Set objRs = Nothing
Call SaveLog(Session("XM"),"系统登录","登录成功")
Call CloseConn()
Call JavaScript("top.location.href='./';")
Exit Sub
End If
Else
'帐号不存在
Set objRs = Nothing
Call SaveLog("未知","系统登录","帐户不存在")
Call CloseConn()
Call JavaScript("alert('帐户不存在,请重新登录!!');location.href='?';")
Exit Sub
End If
Set objRs = Nothing
Call CloseConn
End Sub
Sub logout()
Session.Abandon()
Call SaveLog(Session("XM"),"系统登录","退出登录")
Call JavaScript("alert('你已经退出本系统!!');top.location.href='./';")
Call CloseConn()
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -