1. Computing

How to find a user's IP address using PHP

By

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:

    <?php
    $ip = getenv("REMOTE_ADDR") ;
    Echo "Your IP is " . $ip;
    ?>

     

    ©2014 About.com. All rights reserved.