SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot Technics's Avatar
    Join Date
    Aug 2000
    Posts
    184
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've made a form that logs certain information to a log file called log.html. But i don't know how to make it log the ip of the person that pushed the submit button.

    It logs everything else but id like it to log the ip address too but can't for the life of me figure out how todo it. The form is inside a cgi script also.

    Any ideas?.

  2. #2
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,939
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you need to access the http variables.

    REMOTE_ADDR is the IP, so in PHP it'd be $REMOTE_ADDR, cold fusion #REMOTE_ADDR#. Etc

    HTTP_USER_AGENT
    HTTP_REFERER

    are also commonly used ones.

  3. #3
    SitePoint Zealot Technics's Avatar
    Join Date
    Aug 2000
    Posts
    184
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks but how do i get it to print the remote ip to the log file?.

  4. #4
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,939
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the same way you print the other variables you are logging.

    You can refer to it just like any other variable.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •