📄 chkadmin.asp
字号:
<!--#include file="cn.asp"-->
<%dim mingzi,mima,passcode
mingzi=replace(trim(request.form("mingzi")),"'","")
mima=replace(trim(request.Form("mima")),"'","")
if mingzi="" or mima="" then
response.Write "<script LANGUAGE='javascript'>alert('登录失败!请检查您的登录名和密码!');history.go(-1);</script>"
cn.Close
set cn=nothing
response.end
end if
if not isnumeric(request.form("passcode")) then
response.Write "<script LANGUAGE='javascript'>alert('登录失败!验证码必须是数字,请正确填写!');history.go(-1);</script>"
conn.Close
set cn=nothing
response.end
end if
passcode=Cint(request.form("passcode"))
set rs=server.CreateObject("adodb.recordset")
sql="select * from admin where mima='"&mima&"' and mingzi='"&mingzi&"' "
rs.open sql,cn,1,1
if rs.bof and rs.eof then
response.write "<script LANGUAGE='javascript'>alert('登录失败,无效用户!');history.go(-1);</script>"
rs.Close
set rs=nothing
cn.Close
set cn=nothing
response.end
else
if passcode<>Session("GetCode") then
response.Write "<script LANGUAGE='javascript'>alert('登录失败!验证码错误!');history.go(-1);</script>"
rs.Close
set rs=nothing
conn.Close
set conn=nothing
response.end
end if
if mingzi=rs("mingzi") and mima=rs("mima") then
session("admin")=trim(rs("mingzi"))
session.Timeout=20
response.Cookies("timesshop")("admin")=trim(request.form("mingzi"))
rs.Close
set rs=nothing
cn.Close
set cn=nothing
response.Redirect "index.asp"
else
response.write "<script LANGUAGE='javascript'>alert('你的密码错误,登录失败!');history.go(-1);</script>"
rs.Close
set rs=nothing
cn.Close
set cn=nothing
end if
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -