1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

How to find a user's IP address using PHP


Top Related Searches
  • security purposes
  • ip address
  • lt
  • You can get a user's IP address using PHP code. You can then use the address to locate where the user is visiting from for targeted advertising, record their location for security purposes, or even report this information back to the user.

    The code below will get the IP information for a visitor to your site:

    $ip = getenv("REMOTE_ADDR") ;
    Echo "Your IP is " . $ip;


    ©2014 About.com. All rights reserved.