📄 usercheck.asp
字号:
<%
dim key,toppath,dbpath
key="a2"
toppath=""
dbpath=""
%>
<!--#include file="db_conn.asp"-->
<!--#include file="my_lib/char.asp"-->
<!--#include file="my_lib/md5.asp"-->
<%
Call Chkhttp()
dim sql,rs
dim username,password,CheckCode,userid,passid,codeid
userid=checkStr(request.form("login_name"))
passid=checkStr(request.form("login_pass"))
codeid=checkStr(request.form("codeid"))
user=replace(trim(userid),"'","")
pass=replace(trim(passid),"'","")
CheckCode=replace(trim(request.form("codeid")),"'","")
if user="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>用户名不能为空!</li>"
end if
if pass="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>密码不能为空!</li>"
end if
if CheckCode="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>验证码不能为空!</li>"
end if
if session("CheckCode")="" then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>你登录时间过长,请重新返回登录页面进行登录。</li>"
end if
if CheckCode<>CStr(session("CheckCode")) then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>您输入的确认码和系统产生的不一致,请重新输入。</li>"
end if
if FoundErr<>True then
pass=md5(pass,32)
set rs=server.createobject("adodb.recordset")
sql="select * from user_info_list where txt_login_pass='"&pass&"' and txt_login_name='"&user&"'"
rs.open sql,conn,1,3
if rs.bof and rs.eof then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>用户名或密码错误1!!!</li>"
else
if session("chk_name")=rs("txt_login_name") then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>此用户已经登录!!!</li>"
else
if pass<>rs("txt_login_pass") then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>用户名或密码错误2!!!</li>"
else
rs("lastlogin_time")=now()
rs("login_nums")=rs("login_nums")+1
rs("last_login_ip")=Request.ServerVariables("REMOTE_ADDR")
rs.update
session("chk_id")=rs("id")
session("chk_name")=rs("txt_login_name")
session("chk_flag")=true
rs.close
set rs=nothing
conn.close
set conn=nothing
Session("CheckCode")=""
response.redirect "myaccout.asp"
end if
end if
end if
rs.close
set rs=nothing
end if
if FoundErr=True then
call WriteErrMsg()
end if
conn.close
set conn=nothing
'****************************************************
'过程名:WriteErrMsg
'作 用:显示错误提示信息
'参 数:无
'****************************************************
sub WriteErrMsg()
dim strErr
strErr=strErr & "<html><head><title>错误信息</title><meta http-equiv='Content-Type' content='text/html; charset=gb2312'>" & vbcrlf
strErr=strErr & "<link href='css/main.css' rel='stylesheet' type='text/css'></head><body>" & vbcrlf
strErr=strErr &"<div align=center>" & vbcrlf
strErr=strErr & "<table cellpadding='0' cellspacing='1' bgcolor='#FFFFFF' border=0 width=400>" & vbcrlf
strErr=strErr & "<tr align='left'><td height='26' align='center' background='image/admin_bg_1.gif'><strong>错误信息</strong></td></tr>" & vbcrlf
strErr=strErr & "<tr><td height='100' align='left'><b>产生错误的可能原因:</b><br>" & errmsg &"</td></tr>" & vbcrlf
strErr=strErr & "<tr align='center'><td><a href='login.asp'><< 返回登录页面</a></td></tr>" & vbcrlf
strErr=strErr & "</table>" & vbcrlf
strErr=strErr & "</div>" & vbcrlf
strErr=strErr & "</body></html>" & vbcrlf
response.write strErr
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -