This topic is locked

IP User name and time loged in stored to DB

2/20/2005 11:48:05 AM
ASPRunnerPro General questions
T
tsschicago author

Is it possible to ad a code to login.asp so that when the user logs in it will record his IP, the user ID & Time he loged in? If so Please help.

Sergey Kornilov admin 2/22/2005

tsschicago,
You need to open the login.asp in Editor and find the following record

Response.Redirect Replace("menu.asp", "%20", " ")

else

rs.MoveNext

end if



or the following one

Response.Redirect Replace("..._list.asp", "%20", " ")

else

rs.MoveNext

end if


and put your code before it. The code can look like the following:

dbConnection.Execute "insert into logins (user, time) values ( '" &  Session("UserID") & "', #"& now() &"#)"
T
tsschicago author 2/27/2005

Thanks works great for user ID and Time but its not putting in IP Adress. Is it possible to add to it unsucessful logins?