Get And Save A Client's IP Address, Location, And Other Data In PHP
This shows how to get a user’s IP address and geographic location, save them to a spreadsheet, and display them to the user. Saving the client’s internet service provider, latitude and longitude coordinates, browser, operating system, and a timestamp are also demonstrated.
Source code is available at http://robinsonprogramming.com/tuts/download.php?page=downloads_php_$_save_ip_address.zip
http://www.RobinsonProgramming.com
UPDATE: Make sure you define the query string variable as follows:
$QUERY_STRING = preg_replace(“%[^/a-zA-Z0-9@,_=]%”, ”, $_SERVER[‘QUERY_STRING’]);
ip address