Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Dec 2006
    Posts
    177
    Thanks
    7
    Thanked 0 Times in 0 Posts

    How to detect IP

    Umm I need help detecting someone's IP adress:
    This is my code
    PHP Code:
    <?php
    if (getenv("HTTP_X_FORWARDED_FOR")) 
    $ip getenv("HTTP_X_FORWARDED_FOR");
    else 
    $ip getenv("REMOTE_ADDR");
    ?>
    Please help me
    Last edited by nolvorite; 07-12-2007 at 05:02 PM.

  • #2
    ess
    ess is offline
    Regular Coder
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    866
    Thanks
    7
    Thanked 30 Times in 29 Posts
    The code you provided above should do it. Unless you are looking to find the geo location of website visitors. If that is the case, check this url

    http://www.phpclasses.org/browse/package/1477.html

    Cheers,
    Ess


  •  

    Posting Permissions

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