📄 index.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 + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername=CStr(Request.Form("txtuser"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="su.asp"
MM_redirectLoginFailed="index.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_conn_STRING
MM_rsUser.Source = "SELECT name, pwd"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM user WHERE name='" & Replace(MM_valUsername,"'","''") &"' AND pwd='" & Replace(Request.Form("txtpwd"),"'","''") & "'"
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
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
.style1 {font-size: 24px}
-->
</style>
</head>
<body>
<form action="<%=MM_LoginAction%>" method="POST" name="frmlogin" id="frmlogin">
<table width="303" border="0" align="center" bgcolor="#6699CC">
<tr>
<td colspan="3"><div align="center"><span class="style1">用户登录</span></div></td>
</tr>
<tr>
<td width="87"><span class="style1">用户名</span></td>
<td width="177"><span class="style1">
<input name="txtuser" type="text" id="txtuser">
</span></td>
<td width="17" rowspan="3"><span class="style1"></span><span class="style1"></span><span class="style1"></span></td>
</tr>
<tr>
<td><span class="style1">密码</span></td>
<td><span class="style1">
<input name="txtpwd" type="password" id="txtpwd">
</span></td>
</tr>
<tr>
<td><span class="style1"></span></td>
<td><span class="style1">
<input type="reset" name="Submit" value="重置">
<input type="submit" name="Submit2" value="登录">
</span></td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -