Poor mans GeoIP – Quick and Easy Geolocation

0
242

//poor mans geoip
$country=trim(file_get_contents(“http://api.hostip.info/country.php?ip=”.$_SERVER[‘REMOTE_ADDR’]));

//You can then redirect customers to different offers depending on country. I wouldn’t recommend this for critical or high volume use.

if ($country == ‘MyCountry’) { yadda yadda yadda; }

LEAVE A REPLY

Please enter your comment!
Please enter your name here