Monday, October 29, 2012

how to track ip address by country in php


 $ip=$_SERVER['REMOTE_ADDR'];
 $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.$ip));
 echo $city = stripslashes(ucfirst($addr_details[geoplugin_city]));
 echo $countrycode = stripslashes(ucfirst($addr_details[geoplugin_countryCode]));
 echo $country = stripslashes(ucfirst($addr_details[geoplugin_countryName]));
   
   

No comments:

Post a Comment