ASP Insert record on login page

Posted on 2006-05-18
Last Modified: 2012-05-05

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.
Question by:bains1000
    LVL 48

    Accepted Solution

    >>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.
    LVL 3

    Expert Comment

    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)


    Author Comment

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Suggested Solutions

    For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
    This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now