📄 login.asp
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/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=#ffffff leftMargin=0 topMargin=0 onLoad="setfocus()">
<!--#include file="Index_Top.asp"-->
<TABLE width="760" border=0 align="center" cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<TD width=1 background="images/dotLine_h.gif"><IMG src="images/shim(1).gif" width=1></TD>
<TD Width="100" align="center" bgcolor="#EEEEEE"> </TD>
<td width="10" bgcolor="#F2FBF2"></td>
<TD align="center" bgcolor="#F2FBF2">
<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="262" border="0" align="center" height="123" cellspacing="3" cellpadding="0">
<tr>
<td height="30" align="right" valign="middle"> <b>用户名:</b> </td>
<td height="30" align="left" valign="middle">
<input Name="UserName" type="text" size="15">
</td>
</tr>
<tr>
<td height="30" align="right" valign="middle"><b>密 码:</b>
</td>
<td height="30" align="left" valign="middle">
<input Name="password" type="password" value="" size="15">
</td>
</tr>
<tr valign="middle">
<td colspan="2" align="center">
<input type="submit" Name="Submit" value="登 录">
</td>
</tr>
</table>
<br>
未登录用户只能使用“<a href="InfoQuery.asp">学生信息查询</a>”和“<a href="ScoreQueryStep1.asp">学生成绩查询</a>”功能!
</form></td>
<TD width=1 background="images/dotLine_h.gif"><IMG src="images/shim(1).gif" width=1></TD>
</TR>
<tr>
<TD height="1" colspan="7" background="images/dotLine_w.gif"><IMG height=1 src="images/shim(1).gif" width=100></TD>
</tr>
</TBODY>
</TABLE>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<Iframe src="http://cqzx.sdedu.net/sdms/CopyRight.asp" width="760" height="200" 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 + -