%@language=vbscript codepage=936 %>
<%
dim Action,FoundErr,ErrMsg
dim rs,sql
Action=trim(request("Action"))
if Action="Check" then
call CheckUser()
else
call main()
end if
if FoundErr=true then
call WriteErrMsg()
end if
call CloseConn()
sub main()
%>
注册用户登录
<%
end sub
sub CheckUser()
dim password,CheckNum
username=replace(trim(request("username")),"'","")
password=replace(trim(Request("password")),"'","")
CheckNum=replace(trim(Request("CheckNum")),"'","")
if UserName="" then
FoundErr=True
ErrMsg=ErrMsg & "
用户名不能为空!
"
end if
if Password="" then
FoundErr=True
ErrMsg=ErrMsg & "
密码不能为空!
"
end if
if CheckNum="" then
FoundErr=True
ErrMsg=ErrMsg & "
密码不能为空!
"
end if
if FoundErr=True then
exit sub
end if
password=md5(password)
set rs=server.createobject("adodb.recordset")
sql="select * from " & db_User_Table & " where " & db_User_LockUser & "=False and " & db_User_Name & "='" & username & "' and " & db_User_Password & "='" & password &"'"
rs.open sql,Conn_User,1,3
if rs.bof and rs.eof then
FoundErr=True
ErrMsg=ErrMsg & "
用户名或密码错误!!!
"
else
if password<>rs(db_User_Password) then
FoundErr=True
ErrMsg=ErrMsg & "
用户名或密码错误!!!
"
else
if AdminCheckReg="Yes" then
rs(db_User_UserLevel)=2000
rs.update
call WriteSuccessMsg("恭喜你通过了Email验证。请等待管理开通你的帐号。开通后,你就正式正为本站的一员了。")
else
rs(db_User_UserLevel)=999
rs.update
call WriteSuccessMsg("恭喜你正式成为本站的一员。")
call SaveCookie_asp163()
end if
end if
end if
rs.close
set rs=nothing
end sub
sub SaveCookie_asp163()
Response.Cookies("asp163")("UserName")=rs(db_User_Name)
Response.Cookies("asp163")("Password") = rs(db_User_Password)
Response.Cookies("asp163")("UserLevel")=rs(db_User_UserLevel)
Response.Cookies("asp163")("CookieDate") = 0
end sub
%>