Hi, i need distinguish what content to display on my site depending on where my users are accessing the site from... Is there a general php script that is used that has an IP algorithm that can tell / guess what country a user is browsing a site from or di need to develop one from scratch, thanks in advance for your help...
<?php if(isset($_GET["ip"])){ echo geolocate($_GET["ip"]); } function geolocate($ip){ $raw_html = file_get_contents("http://www.geody.com/geoip.php?ip=$ip"); if(preg_match('/Location:(.*)/',$raw_html,$matches)){ $location_raw = $matches[1]; //Get rid of pesky HTML tags $location = preg_replace("/<[^>]*>/","",$location_raw); return $location; }else{ return "ERROR"; } } ?> PHP: Then I would make a script that matches the country and finds a currency based off of the result of the above script Source: http://stackoverflow.com/questions/...cation-without-having-the-user-install-google Google usually has decent answers