📄 login.asp
字号:
<!-- #include file="const.asp" -->
<!-- #include file="convertpw.asp"-->
<%
dim sql,rs,name,password,fail,purl,usercookies,checkcode
name=trim1(request.form("name"))
password=trim1(request.form("password"))
purl=trim(request.form("purl"))
checkcode=trim(request.form("checkcode"))
usercookies=request.form("CookieDate")
if name="" then
call msg("请先输入帐号")
end if
if password="" then
call msg("请输入密码")
end if
if checkcode="" then
call msg("请输入验证码")
end if
if isnull(session("ImageCode")) or session("ImageCode")="" then
call msg("你登录时间过长,请重新返回登录页面进行登录。")
end if
if checkcode<>CStr(session("ImageCode")) then
call msg("您输入的验证码和系统产生的不一致,请重新输入。")
end if
session("ImageCode")=""
password=convertpw(password)
call opendb()
sql="select * from m3_users where name='"&name&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
if rs.eof and rs.bof then
fail=1
else
if rs("password")<>password then
fail=1
else
if rs("power")=0 then
fail=0
else
fail=0
if rs("power")=2 then response.Cookies("matrix3")("matrix3_admin")="matrix3"
rs("lastlogin")=now
rs("ip")=request.servervariables("remote_addr")
rs("logintimes")=cint(rs("logintimes"))+1
rs("meili")=cint(rs("meili"))+1
rs("jingyan")=cint(rs("jingyan"))+1
rs("money")=cint(rs("money"))+10
rs.update
if isnull(usercookies) or usercookies="" then usercookies="0"
select case usercookies
case "0"
Response.Cookies("matrix3")("usercookies") = usercookies
case "1"
Response.Cookies("matrix3").Expires=Date+1
Response.Cookies("matrix3")("usercookies") = usercookies
case "2"
Response.Cookies("matrix3").Expires=Date+31
Response.Cookies("matrix3")("usercookies") = usercookies
case "3"
Response.Cookies("matrix3").Expires=Date+365
Response.Cookies("matrix3")("usercookies") = usercookies
end select
response.Cookies("matrix3")("matrix3_name")=name
response.Cookies("matrix3")("matrix3_pw")=password
response.Cookies("matrix3_login")("clickedstr")=""
response.Cookies("matrix3")("matrix3_online")=""
response.Cookies("matrix3_login")("login")="1"
'response.Cookies("matrix3").path="/bbs/"
'response.Cookies("matrix3_login").path="/bbs/"
end if
end if
end if
rs.close
set rs=nothing
call closedb()
if fail=1 then
call msg("帐号或密码错误,请重新输入。")
else
if purl="" then
response.Redirect(request.servervariables("HTTP_REFERER"))
else
response.Redirect(purl)
end if
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -