📄 a_login.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/gconn.asp" -->
<!--#include file="inc/md5.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("xingming"))
If MM_valUsername <> "" Then
Dim MM_fldUserAuthorization
Dim MM_redirectLoginSuccess
Dim MM_redirectLoginFailed
Dim MM_loginSQL
Dim MM_rsUser
Dim MM_rsUser_cmd
MM_fldUserAuthorization = ""
MM_redirectLoginSuccess = "index.asp"
MM_redirectLoginFailed = "err.html"
MM_loginSQL = "SELECT g_ming, g_ma"
If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization
MM_loginSQL = MM_loginSQL & " FROM g_man WHERE g_ming = ? AND g_ma = ?"
Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")
MM_rsUser_cmd.ActiveConnection = MM_gconn_STRING
MM_rsUser_cmd.CommandText = MM_loginSQL
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 50, MM_valUsername) ' adVarChar
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 50, md5(Request.Form("mima"))) ' adVarChar
MM_rsUser_cmd.Prepared = true
Set MM_rsUser = MM_rsUser_cmd.Execute
If Trim(Request.Form("validatecode"))=Empty Or Trim(Session("Num"))<>Trim(Request.Form("validatecode")) Then
response.write("<script> alert('请您正确输入验证码')</script>")
response.write("<a href='javascript:window.history.go(-1)'>点这里返回</a>")
response.end
end if
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 XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Gxjss留言本(Asp程序)后台管理</title>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<p> </p>
<table width="600" border="0" align="center" cellpadding="4" bgcolor="#FFFFFF" class="bkse">
<tr>
<td colspan="2" bgcolor="#DEEFF7"><b>后台管理</b></td>
</tr>
<tr>
<td width="128" height="260"> </td>
<td width="448"><form id="form1" name="form1" method="POST" action="<%=MM_LoginAction%>">
<p>用户名:
<input type="text" name="xingming" id="xingming" />
</p>
<p>密 码:
<input name="mima" type="password" id="mima" value="" />
</p>
<p>验证码:
<input name='validatecode' type='text' size='8' maxlength="5">
<img src="inc/yzm.asp" alt="验证码" id="codeImg" /> <a href="#" onclick="javascript:document.getElementById('codeImg').src='inc/yzm.asp?' + Math.random();return false;">看不清楚刷新</a></p>
<p>
<input type="submit" name="button" id="button" value="登陆" />
<input type="reset" name="button2" id="button2" value="重置" />
<a href="index.asp">返回首页</a></p>
</form> </td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -