%@ LANGUAGE="VBSCRIPT" %>
<%
dim rs
dim sql
dim UserIP
dim username
dim userclass
dim password
dim article
sub chkuser()
UserIP=Request.ServerVariables("REMOTE_ADDR")
if request("username")="" then
errmsg=errmsg+"
"+"
请输入您的用户名。"
founderr=true
else
username=trim(replace(request("username"),"'",""))
end if
if request("password")="" then
errmsg=errmsg+"
"+"请输入您的密码。"
founderr=true
else
password=trim(replace(request("password"),"'",""))
end if
usercookies=request("CookieDate")
if chkuserlogin(username,password,usercookies,1)=false then
errmsg=errmsg+"
"+"您的用户名并不存在,或者您的密码错误,或者您的帐号已被管理员锁定。"
founderr=true
end if
end sub
sub activeuser()
dim membername
dim memberword
dim memberclass
membername=request.cookies("aspsky")("username")
memberword=request.cookies("aspsky")("password")
memberclass=request.cookies("aspsky")("userclass")
statuserid=replace(Request.ServerVariables("REMOTE_HOST"),".","")
if session("userid")<>"" then
sql="delete from online where id="&cstr(session("userid"))
Conn.Execute sql
end if
sql="select * from online where username='"&membername&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
if rs.eof and rs.bof then
sql="insert into online(id,username,userclass,ip,startime,lastimebk,lastime,browser,stats,actforip,ComeFrom,actCome) values "&_
"("&statuserid&",'"&membername&"','"&memberclass&"','"&_
Request.ServerVariables("REMOTE_HOST")&"',Now(),Now(),'"&DateToStr(now())&"','"&_
Request.ServerVariables("HTTP_USER_AGENT")&"','论坛首页','"&_
Request.ServerVariables("HTTP_X_FORWARDED_FOR")&"','"&ComeFrom&"','"&actCome&"')"
conn.execute(sql)
else
sql="update online set lastimebk=Now(),lastime='"&DateToStr(now())&"',ComeFrom='"&ComeFrom&"',actCome='"&actCome&"' where username='"&membername&"'"
'response.write sql
conn.execute(sql)
end if
rs.close
set rs=nothing
end sub
stats="用户登陆"
call chkuser()
if founderr then
call nav()
call headline(1)
call error()
else
call nav()
call headline(1)
call success()
end if
call endline()
sub success()
%>
<%if instr(request("comeurl"),"regpost.asp")>0 or instr(request("comeurl"),"login.asp")>0 or instr(request("comeurl"),"chklogin.asp")>0 or trim(request("comeurl"))="" then%>
<%else%>
<%end if%>
<%
end sub
%>