%
Action=Trim(request("Action"))
if Action="Login" then
dim sql
dim rs
dim username
dim password
username=replace(trim(request("username")),"'","")
password=replace(trim(Request("password")),"'","")
password=md5(password)
set rs=server.createobject("adodb.recordset")
sql="select * from [User] where LockUser=False and username='" & username & "' and password='" & password &"'"
rs.open sql,conn,1,3
if not(rs.bof and rs.eof) then
if password=rs("password") then
rs("LoginIP")=Request.ServerVariables("REMOTE_ADDR")
rs("LastLoginTime")=now()
rs("logins")=rs("logins")+1
rs.update
session("UserName")=rs("username")
Response.Redirect "UserServer.asp"
end if
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
end if
%>
|
|
用户注册 |
|
|
|
|