📄 login.asp
字号:
<!--#include file="../chklogin.asp"-->
<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from setup where id=1",conn,1,1
website_name=rs("website_name")
rs.close
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=website_name%> - 用户管理中心</title>
<style type="text/css">
<!--
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
a:link {
color: #000000;
}
a:visited {
color: #000000;
}
a:hover {
color: #FF6600;
}
-->
</style>
<link href="../images/style.css" rel="stylesheet" type="text/css">
</head>
<body leftMargin="0" topMargin="0" bgcolor="#FFFFFF">
<!--#include file="header.asp"-->
<table width="776" height="400" border="0" align="center" cellpadding="0" cellspacing="0" class="t1">
<tr>
<td width="260" height="36" rowspan="2" background="../images/img22.gif"><img src="../images/img29.gif" width="220" height="36"></td>
<td width="9" height="36" rowspan="2" valign="top"><img src="../images/1_04.jpg" width="9" height="36"></td>
<td height="11" background="../images/1_05.jpg"></td>
</tr>
<tr>
<td height="25"><a href="index.asp">用户管理中心</a> - 用户登陆 </td>
</tr>
<tr>
<td width="260" align="center" valign="top"><table width="240" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
</table>
<table width="120" height="35" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="../images/img18.gif" width="23" height="21"></td>
<td align="left"><a href="index.asp"><strong>管理首页</strong></a></td>
</tr>
</table>
<table width="120" height="35" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="../images/img25.gif" width="23" height="21"></td>
<td align="left"><a href="user_data.asp"><strong>修改资料</strong></a></td>
</tr>
</table>
<table width="120" height="35" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="../images/img26.gif" width="23" height="21"></td>
<td align="left"><strong><a href="user_cz.asp">影卡充值</a></strong></td>
</tr>
</table>
<table width="120" height="35" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="../images/img27.gif" width="23" height="21"></td>
<td align="left"><a href="user_msg.asp"><strong>站内短信</strong></a></td>
</tr>
</table>
<table width="120" height="35" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="../images/img28.gif" width="23" height="21"></td>
<td align="left"><a href="user_filmfav.asp"><strong>影片收藏</strong></a></td>
</tr>
</table>
<table width="120" height="35" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30" align="center"><img src="../images/img16.gif" width="23" height="21"></td>
<td align="left"><a href="login.asp?action=logout"><strong>退出登陆</strong></a></td></tr>
</table>
</td>
<td valign="top" background="../images/1_24.jpg"> </td>
<td align="center" valign="top">
<%
action_e=request.Querystring("action")
Select Case action_e
Case ""
Call main()
Case "center"
Call center()
Case "chklogin"
Call chklogin()
Case "chkcenter"
Call chkcenter()
Case "logout"
Call logout()
end select
%>
<%
sub main
if request.cookies("u_type")<>"" then
if request.cookies("u_type")<>3 then
response.write"<script language=javascript>alert('您已经登陆了,请不要重复登陆');history.back();</Script>"
response.end
else
response.write"<script language=javascript>alert('网吧包月用户是根据用户当前IP地址来自动登陆的,无需在此登陆');history.back();</Script>"
response.end
end if
end if
%>
<table width="280" border="0" cellspacing="0" cellpadding="0">
<form name="form1" method="post" action="login.asp?action=chklogin">
<tr>
<td height="25" colspan="2" align="center"><strong>用户登陆</strong></td>
</tr>
<tr>
<td width="80" height="25" align="center">用户账号:</td>
<td align="left"><input name="userid" type="text" class="input2" id="userid" size="20"></td>
</tr>
<tr>
<td height="25" align="center">用户密码:</td>
<td align="left"><input name="u_pwd" type="password" class="input2" id="u_pwd" size="20"></td>
</tr>
<tr>
<td height="25" align="center">验证代码:</td>
<td align="left"><input name="vcode" type="text" class="input2" id="vcode" size="4" maxlength="4">
<img src="../inc/vcode.asp"></td>
</tr>
<tr>
<td height="40" colspan="2" align="center"><input name="image" type="image" src="../images/login.gif" width="48" height="20">
<%if request.querystring("action")="center" then%>
<input name="center" type="hidden" id="center" value="1">
<%end if%></td>
</tr>
<tr>
<td height="40" colspan="2" align="center"><a href="change_ip.asp" class="f2">网吧用户点击此处修改绑定的IP地址</a></td>
</tr>
</form>
</table>
<%end sub%>
<%
sub center
if request.cookies("userid")="" then
response.write"<script language=javascript>alert('请先登陆');history.back();</Script>"
response.end
end if
if request.cookies("u_type")<>3 then
response.write"<script language=javascript>alert('您不是网吧用户,请不要访问本页');history.back();</Script>"
response.end
end if
if request.cookies("center")<>"" then
response.write"<script language=javascript>alert('您已经登陆成功了用户管理中心,请不要重复登陆');history.back();</Script>"
response.end
end if
%>
<table width="280" border="0" cellspacing="0" cellpadding="0">
<form name="form1" method="post" action="login.asp?action=chkcenter">
<tr>
<td height="25" colspan="2" align="center"><strong>网吧用户管理中心登陆</strong></td>
</tr>
<tr>
<td width="80" height="25" align="center">用户账号:</td>
<td align="left"> <%=request.cookies("userid")%></td>
</tr>
<tr>
<td height="25" align="center">用户密码:</td>
<td align="left"><input name="u_pwd" type="password" class="input2" id="u_pwd" size="20"></td>
</tr>
<tr>
<td height="25" align="center">验证代码:</td>
<td align="left"><input name="vcode" type="text" class="input2" id="vcode" size="4" maxlength="4">
<img src="../inc/vcode.asp"></td>
</tr>
<tr>
<td height="40" colspan="2" align="center"><input name="image" type="image" src="../images/login.gif" width="48" height="20"></td>
</tr>
</form>
</table>
<%end sub%>
<%
sub chklogin()
call myobj.chkrq()
if request.form("userid")="" then
response.write"<script language=javascript>alert('请填写用户账号');history.back();</Script>"
response.end
end if
if myobj.ChkID(request.form("userid"))=false then
response.write"<script language=javascript>alert('用户账号只能是字母、数字、下划线,并且第一个字符或最后一个字符不能是下划线');history.back();</Script>"
response.end
end if
if len(request.form("userid"))<3 or len(request.form("userid"))>12 then
response.write"<script language=javascript>alert('用户账号不能小于3个字符,大于12个字符');history.back();</Script>"
response.end
end if
if request.form("u_pwd")="" then
response.write"<script language=javascript>alert('请填写用户密码');history.back();</Script>"
response.end
end if
if myobj.ChkLen(request.form("u_pwd"))<6 or myobj.ChkLen(request.form("u_pwd"))>24 then
response.write"<script language=javascript>alert('用户密码不能小于6个字符,大于24个字符');history.back();</Script>"
response.end
end if
if UCase(request.Form("vcode"))<>session("vcode") then
response.write"<script language=javascript>alert('验证代码错误');history.back();</Script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
rs.open "select * from member where userid='"&request.form("userid")&"'",conn,1,1
if rs.eof then
call nr() '释放对象
response.write"<script language=javascript>alert('该用户并不存在错误');history.back();</Script>"
response.end
end if
if md5(request.form("u_pwd"))<>rs("u_pwd") then
call nr()
response.write"<script language=javascript>alert('密码错误');history.back();</Script>"
response.end
end if
if rs("u_type")=3 then
call nr()
response.write"<script language=javascript>alert('网吧用户账号无需登陆');history.back();</Script>"
response.end
end if
userid=rs("userid") '获取登陆用户的账号
u_pwd=rs("u_pwd") '获取登陆用户的密码
u_type=rs("u_type") '获取登陆用户的类型
rs.close
set rs=server.createobject("adodb.recordset") '查询当前用户是否已登陆
rs.open "select * from online where userid='"&request.form("userid")&"'",conn,1,1
if not rs.eof then '如果记录不为空,则存在
action_time=rs("action_time")
call nr()
response.write"<script language=javascript>alert('当前用户已登陆在本系统,并且最后一次活动的时间在:"&action_time&"。在该账号退出本系统之间,您不能再使用本账号登陆。或者等待该账号活动超时后再登陆');history.back();</Script>"
response.end
end if
rs.close
set rs=server.createobject("adodb.recordset") '查询系统设置的用户超时时间
rs.open "select * from setup where id=1",conn,1,1
setup_timeout=rs("timeout")
rs.close
response.cookies("userid")=userid
response.Cookies("userid").expires=now()+cint(setup_timeout)
response.cookies("u_pwd")=u_pwd
response.Cookies("u_pwd").expires=now()+cint(setup_timeout)
response.cookies("u_type")=u_type
response.Cookies("u_type").expires=now()+cint(setup_timeout)
if u_type<>3 then
set rs=server.createobject("adodb.recordset") '向online表写入登陆信息
rs.open "select * from online where (id is null)",conn,1,3
rs.addnew
rs("userid")=userid
rs("u_type")=u_type
rs.update
rs.close
end if
%>
<!--头号-->
<table width="490" height="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><%if request.form("center")<>"" then%>欢迎用户:<span class="f3"><%=request.form("userid")%></span> 登陆后台管理中心,您现在可以在管理中心进行其它的操作了<%else%>欢迎用户:<span class="f3"><%=request.form("userid")%></span> 登陆!<a href="../index.asp">点击此处返回首页</a><%end if%></td>
</tr>
</table>
<%
end sub
%>
<%
sub chkcenter()
call myobj.chkrq()
if request.cookies("userid")="" then
response.write"<script language=javascript>alert('请先登陆');history.back();</Script>"
response.end
end if
if request.cookies("u_type")<>3 then
response.write"<script language=javascript>alert('您不是网吧用户,请不要访问此页');history.back();</Script>"
response.end
end if
if request.cookies("userid")="" then
response.write"<script language=javascript>alert('错误!网吧用户账号为空');history.back();</Script>"
response.end
end if
if myobj.ChkID(request.cookies("userid"))=false then
response.write"<script language=javascript>alert('错误!用户账号只能是字母、数字、下划线,并且第一个字符或最后一个字符不能是下划线');history.back();</Script>"
response.end
end if
if len(request.cookies("userid"))<3 or len(request.cookies("userid"))>12 then
response.write"<script language=javascript>alert('错误!用户账号不能小于3个字符,大于12个字符');history.back();</Script>"
response.end
end if
if request.form("u_pwd")="" then
response.write"<script language=javascript>alert('请填写用户密码');history.back();</Script>"
response.end
end if
if myobj.ChkLen(request.form("u_pwd"))<6 or myobj.ChkLen(request.form("u_pwd"))>24 then
response.write"<script language=javascript>alert('用户密码不能小于6个字符,大于24个字符');history.back();</Script>"
response.end
end if
if UCase(request.Form("vcode"))<>session("vcode") then
response.write"<script language=javascript>alert('验证代码错误');history.back();</Script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
rs.open "select * from member where userid='"&request.cookies("userid")&"' and u_type=3",conn,1,1
if rs.eof then
call nr() '释放对象
response.write"<script language=javascript>alert('该用户并不存在错误');history.back();</Script>"
response.end
end if
if md5(request.form("u_pwd"))<>rs("u_pwd") then
call nr()
response.write"<script language=javascript>alert('密码错误');history.back();</Script>"
response.end
end if
response.cookies("center")=1
call cr() '关闭对象
%>
<!--头号-->
<table width="490" height="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">用户管理中心登陆成功,您现在可以在管理中心进行其它的操作了</td>
</tr>
</table>
<%
end sub
%>
<%
sub logout()
if request.cookies("userid")="" then
response.write"<script language=javascript>alert('您没有登陆,不需要退出');history.back();</Script>"
response.end
end if
if request.cookies("u_type")=3 then
response.cookies("center")=""
%>
<table width="490" height="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">您已经退出用户管理中心,下次进入时需要输入密码</td>
</tr>
</table>
<%
else
conn.execute "delete From online Where userid='"&request.cookies("userid")&"'"
response.cookies("userid")=""
response.cookies("u_pwd")=""
response.cookies("u_type")=""
response.cookies("center")=""
%>
<table width="490" height="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">您已经完全退出本站</td>
</tr>
</table>
<%
end if
end sub
%>
<!--尾--></td>
</tr>
</table>
<!--#include file="footer.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -