ASP Insert record on login page


I have an application in dreamweaver that requires users to login.
Is it possible to log information on who's logged in and from what ip address?  I would like this information to be entered into a table in the database automatically when users login.

Thanks in advance.
Who is Participating?
Ryan ChongCommented:
>>I would like this information to be entered into a table in the database automatically when users login
Yes, it's possible, the trick is that you execute a SQL statement to "save" the info you want (IP address, date time, etc) when the user logging to your web pages.

Server side scripting is needed here, for example, to get the user's IP address in ASP, we can try use:


and that's vary if you using other Server side scripting langauges.

Hope this give you some clues on how to develop this feature.
Curtis ShullFounderCommented:
To log  IP addresses into namesthrough software is the best way to go. Especially if your network runs dynamic IP's, which most do. But if you do have STATIC IP addresses, then you can do the same as outlined below  then track the IP address in the database. Easier to do than the NT authentication, just as long as the IP's never change. But, if they do change...then things will get all mucked up.

Let's say you have a database of all employees which gives  a unique ID for each. Using NT authentication, you can determine each visitors User Login Name:

THIS_USER = split(Request.ServerVariables("REMOTE_USER"),"\",-1,1)

bains1000Author Commented:
It was actually quite simple.

I just created an insert record on the existing login form, added a few fields and it works great.

Thanks for your help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.