📄 admin_login.asp
字号:
<!--#include file="Include/conn.asp"-->
<!--#include file=Include/check.asp-->
<!--#include file="Include/Md5.asp" -->
<%
response.expires = 0
if request("Action")="chk" then
username=Checkin(trim(Request.form("username")))
password=Checkin(trim(Request.form("password")))
Md5_Pass=md5(password)
if username="" or password="" then Response.Redirect ("Admin_login.asp")
set rs=server.createobject("adodb.recordset")
sql="select * from admin where username='"&username&"'and password='"&Md5_Pass&"'"
rs.open sql,conn,1,3
if not rs.EOF then
rs("LoginTimes")=rs("LoginTimes")+1
rs("LoginTime")=now()
rs("LoginIP")=Request.ServerVariables("REMOTE_ADDR")
rs.Update
Session("AdminID")=rs("id")
Session("WendaySys_User")=rs("username")
Session("IsAdmin")=true
Session("KEY")=rs("Oskey")
'Session("Admin") = "Login"
Response.Redirect ("admin.asp")
else
errmsg="请输入正确的管理员名字和密码!"
call error()
Response.End
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
if request("Action")="LoginOut" then
IsAdmin=session("IsAdmin")
If IsAdmin=true Then
set rs=server.createobject("adodb.recordset")
AdminID=session("AdminID")
sql="select * from admin where id="&AdminID
rs.open sql,conn,1,3
if not rs.EOF then
rs("LogoutTime")=now()
rs.Update
Session("AdminID")=""
Session("IsAdmin")=""
Session("KEY")=""
'Session("Admin")=""
rs.Close
set rs=nothing
else
response.write"数据库出错!"
Response.end
end if
end if
conn.close
set conn=nothing
response.redirect ("Index.asp")
end if
%>
<link href="Img/Admin.css" rel="stylesheet" type="text/css">
<title>江西博宇 后台管理</title>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<form name="login" method="post" action="Admin_login.asp?Action=chk" target="_top">
<tr>
<td><table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="img/D_Tu_YD1.gif" width="276" height="70" border="0"></td>
<td width="15" rowspan="3"><img src="Img/2.gif" width="17" height="214"></td>
</tr>
<tr>
<td width="276" background="Img/D_Tu_YD4.gif" height="124"> <table border="0" width="100%" cellspacing="0" cellpadding="5">
<tr>
<td width="29%" align="right">帐号:</td>
<td width="42%"><input name="username" id="username" size=12 maxlength="20" class="login"></td>
<td width="29%"> </td>
</tr>
<tr>
<td align="right">密码:</td>
<td><input name="password" type="password" id="password" size=12 maxlength="20" class="login"></td>
<td><input name="Submit" type="image" id="Submit" style="border:0px" onFocus=if(this.blur)this.blur() src="img/D_Tu_DL.gif" alt="登陆系统" width="36" height="35" border="0">
</td>
</tr>
<tr>
<td align="center" colspan="2" height="40"><font color="#FF0000"><b>警告:</b>非法用户请勿登陆</font></td>
<td><input name="Close" class="Botton" type="button" id="Close" title="关闭系统" onclick="javascript:window.close()" value=" 关 闭 "></td>
</tr>
</table></td>
</tr>
<tr>
<td><img src="Img/D_Tu_YD3.gif" width="276" height="20" border="0"></td>
</tr>
</table>
</td>
</tr></form>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -