📄 adminlogin.asp
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/conn.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=CStr(Request.Form("textfield"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization="adminlevel"
MM_redirectLoginSuccess="adminloginok.asp"
MM_redirectLoginFailed="adminloginerr1.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_conn_STRING
MM_rsUser.Source = "SELECT admin, password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM admin WHERE admin='" & replace(MM_valUsername,"'","''") &"' AND password='" & replace(Request.Form("textfield2"),"'","''") & "'"
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 false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="ddd.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="top.asp" -->
<table width="771" border="0" cellspacing="0" cellpadding="0" align="center" height="258" class="bk1">
<tr>
<td valign="top" height="178"><br>
<br>
<table width="695" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<div align="center"><b>管理员登录</b></div>
</td>
</tr>
</table>
<br>
<form name="form1" method="post" action="<%=MM_LoginAction%>">
<table width="274" border="0" cellspacing="3" cellpadding="0" align="center" class="dfont">
<tr>
<td width="78" height="35">用户名:</td>
<td width="218" height="35">
<input type="text" name="textfield" size="20" maxlength="20">
</td>
</tr>
<tr>
<td width="78" height="33">密码:</td>
<td width="218" height="33">
<input type="password" name="textfield2" value="" size="20">
</td>
</tr>
<tr>
<td colspan="2">
<div align="center"><a href="default.asp">我不是管理员</a></div>
</td>
</tr>
</table>
<p align="center">
<input type="submit" name="Submit" value="登录">
</p>
</form>
</td>
</tr>
</table>
<br>
<!--#include file="bottom.asp" -->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -