📄 chkuser.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="func.asp"-->
<%
dim username,password,comeurl,passcode
username=replace(trim(request.Form("username")),"'","")
password=md5(replace(trim(request.form("password")),"'",""))
passcode=Cint(request.form("passcode"))
if trim(request.form("comeurl"))="" then
comeurl="index.asp"
else
comeurl=trim(request.form("comeurl"))
end if
if username="" or password="" then
response.Write "<script LANGUAGE='javascript'>alert('登录失败!请检查您的登录名和密码!');history.go(-1);</script>"
response.end
end if
if passcode<>Session("GetCode") then
response.Write "<script LANGUAGE='javascript'>alert('登录失败!验证码错误!');history.go(-1);</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from [user] where username='"&username&"' and password='"&password&"' " ,conn,1,3
if not(rs.bof and rs.eof) then
if password=rs("password") and passcode=Session("GetCode") then
response.Cookies("timesshop")("username")=trim(request.form("username"))
rs("lastvst")=now()
rs("loginnum")=rs("loginnum")+1
rs.Update
rs.Close
set rs=nothing
call loginok()
else
response.write "<script LANGUAGE='javascript'>alert('登录失败,请检查您的登录名和密码!');history.go(-1);</script>"
end if
else
response.write "<script LANGUAGE='javascript'>alert('登录失败!请检查您的登录名和密码!');history.go(-1);</script>"
end if
sub loginok()
response.Write "<font size=2>欢迎 <font color=red size=2>"&request.Cookies("timesshop")("username")&"</font>,光临两秒种后将自动跳转到相应页!</font>"
response.redirect comeurl
end sub
conn.close
set conn = nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -