📄 login.asp
字号:
<!--#include file="mdb_path_user.asp"-->
<!--#include file="config.asp"-->
<!--#include file="MD5.asp"-->
<%
'-----------------彩色验证码---------------------
'If request("GetCode")="" or isnull(request("GetCode")) then
' xoYuStudioLoginMgs="请输入您的验证码。"
'else
' if int(request("GetCode"))<>int(Session("GetCode")) then xoYuStudioLoginMgs="您的验证码不正确。"
'end if
'------------------------------------------------
xoYuStudioLoginTitle="用户登陆"
if request("xoYuStudioType")="logout" then
xoYuStudioLoginTitle="退出登陆"
xoYuStudioLoginMgs="成功:退出登陆成功!"
if Session("xoYuStudioAdminName")<>"" then
Session("xoYuStudioAdminName") =""
Session("xoYuStudioAdminDj")=""
response.cookies("xoYuStudioUserSoftUrl")=""
end if
if request.cookies("xoYuStudioUserName")<>"" then
response.cookies("xoYuStudioUserName") =""
response.cookies("xoYuStudioUserDj")=""
end if
elseif request("xoYuStudioType")="login" then
server_vv=len(Request.ServerVariables("SERVER_NAME"))
server_v1=left(Cstr(Request.ServerVariables("HTTP_REFERER")),server_vv)
server_v2=left(Cstr("http://"&Request.ServerVariables("SERVER_NAME")),server_vv)
if server_v1<>server_v2 or server_v1="" or server_v1="" then
response.write("<script>alert('错误:禁止从站点外部提交数据!.')</script>")
response.end
end if
if request.form("user")<>"" and request.form("pwd")<>"" and request.form("getcode")<>"" then
user=replace(request("user")," ","+++ close")
pwd=md5(replace(request("pwd")," ","+++ close"))
set rs=server.createobject("adodb.recordset")
rs.open "select * from UserInfo where user='"&user&"' and pwd='"&pwd&"'",conn,1,1
thesoft=Request.ServerVariables("HTTP_USER_AGENT")
if instr(thesoft,"Windows NT 5.0") then
vOS="Win 2000"
elseif instr(thesoft,"Windows NT 5.1") then
vOs="Win XP"
elseif instr(thesoft,"Windows NT") then
vOs="Win NT"
elseif instr(thesoft,"Windows 9") then
vOs="Win 9x"
elseif instr(thesoft,"unix") or instr(thesoft,"linux") or instr(thesoft,"SunOS") or instr(thesoft,"BSD") then
vOs="类Unix"
elseif instr(thesoft,"Mac") then
vOs="Mac"
else
vOs="Other"
end if
if not rs.eof then
if pwd=rs("pwd") and user=rs("user") and int(request("GetCode"))=int(Session("GetCode")) then
xoYuStudioDj=rs("dj")
if xoYuStudioDj=0 or xoYuStudioDj=1 or xoYuStudioDj=2 or xoYuStudioDj=3 or xoYuStudioDj=4 then
if rs("lock")=1 then
xoYuStudioLoginMgs="错误:帐号 "&user&" 已被锁定,你不能登陆!请联系站长。"
else
xoYuStudioLoginMgs="成功:帐号 "&user&" 登录成功!"
if xoYuStudioDj=0 then SF="普通会员"
if xoYuStudioDj=1 then SF="认证会员"
if xoYuStudioDj=2 then SF="栏目管理员"
if xoYuStudioDj=3 then SF="系统管理员"
if xoYuStudioDj=4 then SF="超级管理员"
response.cookies("xoYuStudioUserName")=rs("user")
response.cookies("xoYuStudioUserDj")=rs("dj")
if xoYuStudioDj=2 or xoYuStudioDj=3 or xoYuStudioDj=4 then
if rs("softurl")<>"" then
response.cookies("xoYuStudioUserSoftUrl")=rs("softurl")
end if
Session("xoYuStudioAdminName")=rs("user")
Session("xoYuStudioAdminDj")=rs("dj")
Session("xoYuStudioAdminAdmin")=rs("admin")
Session("xoYuType")=rs("type")
UserId = rs("id")
set rs1=Server.Createobject("adodb.recordset")
sql1="Select * from Log"
rs1.open sql1,conn,3,3
rs1.addnew
rs1("User")=rs("user")
rs1("LoginIP")=request.ServerVariables("Remote_Addr")
rs1("OS")=vOS
rs1.update
rs1.close
end if
end if
else
xoYuStudioLoginMgs="错误:你的用户等级错误,不能登陆,请与站长联系!"
set rs1=Server.Createobject("adodb.recordset")
sql1="Select * from Log"
rs1.open sql1,conn,3,3
rs1.addnew
rs1("User")=Request.Form("User")
rs1("LoginIP")=request.ServerVariables("Remote_Addr")
rs1("OS")=vOS
rs1("ErrorPas")=Request.Form("pwd")
rs1("Result")="Error"
rs1.update
rs1.close
end if
else
xoYuStudioLoginMgs="错误:用户名|密码|验证码错误!"
set rs1=Server.Createobject("adodb.recordset")
sql1="Select * from Log"
rs1.open sql1,conn,3,3
rs1.addnew
rs1("User")=Request.Form("User")
rs1("LoginIP")=request.ServerVariables("Remote_Addr")
rs1("OS")=vOS
rs1("ErrorPas")=Request.Form("pwd")
rs1("Result")="Error"
rs1.update
rs1.close
end if
else
xoYuStudioLoginMgs="错误:用户名|密码|验证码错误!"
set rs1=Server.Createobject("adodb.recordset")
sql1="Select * from Log"
rs1.open sql1,conn,3,3
rs1.addnew
rs1("User")=Request.Form("User")
rs1("LoginIP")=request.ServerVariables("Remote_Addr")
rs1("OS")=vOS
rs1("ErrorPas")=Request.Form("pwd")
rs1("Result")="Error"
rs1.update
rs1.close
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
else
xoYuStudioLoginMgs="错误:用户名|密码|验证码都不能为空!"
end if
end if
%>
<html>
<head>
<title><%=xoYuStudioLoginTitle%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta copy="程序制作:xoyu(QQ:5964887)www.xoyu.com">
<link rel="stylesheet" href="admin.css" type="text/css">
</head>
<body topmargin="10" leftmargin="0" bgcolor="#FFFFFF" text="#000000">
<form method="post" action="login.asp?xoYuStudioType=login" target="_top">
<div align="center">
<center>
<table border="0" class="tableBorder" cellpadding="2" cellspacing="1" width="600" align="center">
<tr>
<th class="tableHeaderText" colspan=2 height=25 width="592">晓宇听幽工作室“晓宇听幽网站内容管理系统”管理登陆</th>
</tr>
<%if xoYuStudioLoginMgs<>"" then%>
<tr>
<td width="592" bgcolor="#FFFFFF">
<p align="center"><img src="images/admin.jpg" border="0"></td>
<td width="467" bgcolor="#FFFFFF">
<font color="#FF0000">·</font><%=xoYuStudioLoginMgs%>
<%if SF<>"" then%><br><font color="#FF0000">·</font>身份:<font color="#008080"><%=SF%></font><%
if xoYuStudioDj="2" or xoYuStudioDj="3" or xoYuStudioDj="4"then%>
<br><font color="#FF0000">·</font><a href="index.asp">进入系统管理中心</a><%else
%><br><font color="#FF0000">·</font><a href="../">返回首页</a><%end if%>
<br><font color="#FF0000">·</font><%if webuseredit="1" then%><a href="edit.asp"><%end if%>修改个人资料</a>
<br><font color="#FF0000">·</font><a href="login.asp?xoYuStudioType=logout">退出登陆</a>
<br><font color="#FF0000">·</font><a href="login.asp">重新登陆</a><%end if%></td>
</tr>
<%else%>
<tr>
<td width="592" bgcolor="#FFFFFF" colspan="2">
<table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" width="100%" height="68">
<tr>
<td width="50%" align="center" height="20">
<p align="right">用户名<font color="#000000">(<span class="big">U</span>)</font>:<input name="user" maxlength="20" size="15"></td>
<td width="50%" align="center" height="20"> </td>
</tr>
<tr>
<td width="50%" align="center" height="20">
<p align="right">密 码<font color="#000000">(<span class="big">P</span>)</font>:<input type="password" name="pwd" maxlength="20" size="15"></td>
<td width="50%" align="center" height="20"> </td>
</tr>
<tr>
<td width="64%" align="center" height="16">
<p align="right">验证码<font color="#000000">(<span class="big">Y</span>)</font>:<input name="GetCode" maxlength="20" size="15"></td>
<td width="36%" align="center" height="16">
<img src="code.asp" width="38" height="10" align="left"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="592" colspan="2">
<p align="center"><input type="submit" name="Submit" value="登 陆">
<input type="button" name="Submit1" <%if webreg="1" then%>onclick="javascript:location.href='../reg.asp'"<%else%>disabled<%end if%> value="注 册"></td>
</tr>
<%end if%>
</table>
</center>
</div>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -