1. Computing

Discuss in my forum

How to find a user's IP address using PHP

By , About.com Guide

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;
?>

See More About
  1. About.com
  2. Computing
  3. PHP / MySQL
  4. Step By Steps
  5. Finding a user's IP address with PHP

©2013 About.com. All rights reserved.