📄 login.asp
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="StudentConn.asp" -->
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Request.QueryString
MM_valUserName=Replace(CStr(Request.Form("UserName")),"'","")
If MM_valUserName <> "" Then
MM_fldUserAuthorization="accesslevel"
MM_redirectLoginSuccess="Index.asp"
MM_redirectLoginFailed="Login.asp?logonfailed=true"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_StudentConn_STRING
MM_rsUser.Source = "SELECT UserName, password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM User WHERE UserName='" & MM_valUserName &"' AND password='" & Replace(CStr(Request.Form("password")),"'","") & "'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' userName and password match - this is a valid user
Session("MM_UserName") = MM_valUserName
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" And true Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Session.Timeout=600
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>用户登录</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2600.0" Name=GENERATOR>
<link href="home.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
function setfocus()
{
document.form1.UserName.focus();
return;
}
</script>
</HEAD>
<BODY text=#000000 bgColor=#f7f7ff leftMargin=0 topMargin=0 onLoad="setfocus()">
<TABLE width="760" border=0 align="center" cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD align="center" bgcolor="f7f7ff">
<form Name="form1" method="post" action="<%=MM_LoginAction%>">
<br>
<br>
<%
if Request("logonfailed")<>"" then
Response.Write "<b><font size='4'>用户名或密码错误!请重新登录!</font></b><br><br>"
else
if Request.QueryString<>"" then
Response.Write "<b><font size='4'>你还没有登录或登录已超时!请重新登录!</font></b><br><br>"
else
Response.Write "<b><font size='4'>用 户 登 录</font></b><br><br>"
end if
end if
%>
<br>
<table width="250" border="1" style="border-collapse:collapse"cellpadding="0" cellspacing="2" bgcolor="#9BA6F0">
<tr>
<td><table width="100%" align="center" cellpadding="5" cellspacing="0">
<tr>
<td height="40" align=center bgcolor="#E6E6F7"><table width="100%" height="100%" border="1" style="border-collapse:collapse"cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#3366CC" class="LoginTitle">用户登录</td>
</tr>
</table></td>
</tr>
<tr>
<td height="60" align=center bgcolor="#E6E6F7"><span class="content">用户名:</span>
<input name="UserName" size="12" >
<br>
<span class="content">密 码:</span>
<input type=password size="12" name="PassWord">
</td>
</tr>
<tr align=center>
<td height="40" bgcolor="#E6E6F7"><input name="submit" type="image" src="images/buttonlogin.gif" width="52" height="18">
<a href='javascript:ClearForm()'> <img src="images/buttonclear.gif" alt="清除" name="clear" width="52" height="18" border="1" style="border-collapse:collapse"></a> </td>
</tr>
</table></td>
</tr>
</table>
<br>
未登录用户只能使用“<a href="InfoQuery.asp">员工信息查询</a>”和“<a href="ScoreQueryStep1.asp">员工工资查询</a>”功能!
</form></td>
</TR>
</TABLE>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<Iframe src="CopyRight.asp" width="760" height="100" marginheight="0" marginwidth="0" scrolling="NO" frameborder="0" name="CopyRight"></iframe>
</td>
</tr>
</table></BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -