Hi,
Does anyone have any experience with maxmind geoip city?
im trying to redirect users to a different page based on the city they are coming from
I have tried...
<?php
require_once("geoipcity.inc");
$gi = geoip_open("GeoLiteCity.dat",GEOIP_STANDARD);
$city = geoip_record_by_addr($gi, $_SERVER['REMOTE_ADDR']);
geoip_close($gi);
if($city == 'Sydney')
{
header("HTTP/1.1 301 Moved Permanently");
header('Location: http:/ example1.com');
}
else
{
header("HTTP/1.1 301 Moved Permanently");
header('Location: http:/ example2.com');
}
?>
i dont have a lot of experience with PHP but i can get this to work for redirecting based on country, but by city it doesnt work no matter what i try!
if someone could point me in the right direction to get this working i would be really greatfull,