📄 chklogin.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="md5.asp"-->
<%
call head()
dim cookies_path_s,cookies_path_d,cookies_path
LastIP=Request.ServerVariables("REMOTE_ADDR")
if request("username")="" then
errmsg=errmsg+"<br>"+"<li>请输入您的用户名。"
founderr=true
else
username=trim(checkStr(request("username")))
end if
if request("password")="" then
errmsg=errmsg+"<br>"+"<li>请输入您的密码。"
founderr=true
else
password=md5(trim(checkStr(request("password"))))
end if
'判断更新cookies目录
cookies_path_s=split(Request.ServerVariables("PATH_INFO"),"/")
cookies_path_d=ubound(cookies_path_s)
cookies_path="/"
for i=1 to cookies_path_d-1
if not (cookies_path_s(i)="upload" or cookies_path_s(i)="admin") then cookies_path=cookies_path&cookies_path_s(i)&"/"
next
if cookiepath<>cookies_path then
cookiepath=replace(cookies_path,"'","")
conn.execute("update config set cookiepath='"&cookiepath&"'")
end if
if founderr=true then
call txl_error()
response.end
call foot()
else
set rs=server.createobject("adodb.recordset")
sql="select * from [user] where username='"&username&"'"
rs.open sql,conn,1,3
if rs.bof and rs.eof then
errmsg=errmsg+"<br>"+"<li>对不起,找不到该用户!你是不是我们班的吧"
call txl_error()
call foot()
response.end
else
if rs("password")<>password then
errmsg=errmsg+"<br>"+"<li>您输入的密码不正确。"
call txl_error()
call foot()
response.end
elseif rs("lockuser")>=2 then
errmsg=errmsg+"<br>"+"<li>对不起呀,你的帐号被管理员锁定了!"
call txl_error()
call foot()
response.end
else
rs("usermoney")=rs("usermoney")+txl_user(1)
rs("logins")=rs("logins")+1
rs("lastIp")=Request.ServerVariables("REMOTE_ADDR")
rs("lasttime")=Now()
Rs.update
Response.Cookies("mathren")("realname") = rs("realname")
Response.Cookies("mathren")("userid") = rs("userid")
Response.Cookies("mathren")("password") = rs("password")
Response.Cookies("mathren")("skinid") = rs("skinid")
Response.Cookies("mathren").path=cookiepath
end if
end if
rs.Close
set rs=nothing
end if
response.redirect"index.asp"
call foot()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -