📄 checklogin.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="md5.asp"-->
<%
dim sql,rs
dim username,password,CheckCode,FoundErr
username=replace(trim(request("username")),"'","")
password=replace(trim(Request("password")),"'","")
CheckCode=replace(trim(Request("CheckCode")),"'","")
if UserName="" then
FoundErr=True
response.write "<script>alert('对不起!用户名不能为空!!您可以选择不填写!\n\n ---杜子电脑学习网\n\n "&now()&"');location.href='index.htm'</script>"
end if
if Password="" then
FoundErr=True
response.write "<script>alert('对不起!密码不能为空!!!您可以选择不填写!\n\n ---杜子电脑学习网\n\n "&now()&"');location.href='index.htm'</script>"
end if
if CheckCode="" then
FoundErr=True
response.write "<script>alert('对不起!验证码不能为空!!!!您可以选择不填写!\n\n ---杜子电脑学习网\n\n "&now()&"');location.href='index.htm'</script>"
end if
if session("CheckCode")="" then
FoundErr=True
response.write "<script>alert('你登录时间过长,请重新返回登录页面进行登录。\n\n ---杜子电脑学习网\n\n "&now()&"');location.href='index.htm'</script>"
end if
if CheckCode<>CStr(session("CheckCode")) then
FoundErr=True
response.write "<script>alert('您输入的确认码和系统产生的不一致,请重新输入。\n\n ---杜子电脑学习网\n\n "&now()&"');location.href='index.htm'</script>"
end if
if FoundErr<>True then
password=md5(password)
set rs=server.createobject("adodb.recordset")
sql="select * from Admin where password='"&password&"' and username='"&username&"'"
rs.open sql,conn,1,3
if rs.bof and rs.eof then
FoundErr=True
response.write "<script>alert('用户名或密码错误!!!\n\n ---杜子电脑学习网\n\n "&now()&"');location.href='index.htm'</script>"
else
if password<>rs("password") then
FoundErr=True
response.write "<script>alert('用户名或密码错误!!!\n\n ---杜子电脑学习网\n\n "&now()&"');location.href='index.htm'</script>"
else
RndPassword=GetRndPassword(16)
rs("LastLoginIP")=Request.ServerVariables("REMOTE_ADDR")
rs("LastLoginTime")=now()
rs("LoginTimes")=rs("LoginTimes")+1
rs("RndPassword")=RndPassword
rs.update
session.Timeout=SessionTimeout
session("AdminName")=rs("username")
session("AdminPassword")=rs("Password")
session("RndPassword")=RndPassword
rs.close
set rs=nothing
call CloseConn()
Response.Redirect "default.asp"
end if
end if
rs.close
set rs=nothing
end if
if FoundErr=True then
response.write "<script>alert('登录超时!!!\n\n ---杜子电脑学习网\n\n "&now()&"');location.href='index.htm'</script>"
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -