yep, as conzy said geoip.inc and geoip.dat goes in /geo folder
OR
if you want to have geoip.inc and geoip.dat in same folder as index.php, then remove "geo/" on 3rd and 5th line
then your new index.php will be:
PHP:
<?php
include("geoip.inc");
$ip=$_SERVER['REMOTE_ADDR'];
$gi = geoip_open("GeoIP.dat",GEOIP_STANDARD);
$country_code = geoip_country_code_by_addr($gi, "$ip");
// Country name is not used so commented
// Get Country Name based on source IP
//$country = geoip_country_name_by_addr($gi, "$ip");
geoip_close($gi);
switch($country_code)
{
case "US": header("Location: http://offerforusa.com"); break;
case "CA": header("Location: http://offerforcanada.com"); break;
case "UK": header("Location: http://offerforuk.com"); break;
case "AU": header("Location: http://offerforaustralia.com"); break;
case "NZ": header("Location: http://offerfornewzealand.com"); break;
default: header("Location: http://offerforothers.com");
}
?>