Buzzika
Supreme Member
- Jul 8, 2009
- 1,446
- 1,678
I wanted a geo-ip redirection script for one of my projects.
I searched BHW and got the script and db of the ips.
I used the exact same script. but i get this error:
Warning: Cannot modify header information - headers already sent by (output started at /home/janghu07/public_html/getip.php:2) in /home/janghu07/public_html/getip.php on line 20
The ip db and Maxmind API were transferred to the server in Binary mode.
I remember setting this up in 5 minutes when i was using jumpline hosting. Now I am with Hostgator..
Can hostgator be a problem?
I need help...
I searched BHW and got the script and db of the ips.
I used the exact same script. but i get this error:
Warning: Cannot modify header information - headers already sent by (output started at /home/janghu07/public_html/getip.php:2) in /home/janghu07/public_html/getip.php on line 20
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://google.com/"); break;
default: header("Location: http://www.yahoo.com/");
}
?>
I remember setting this up in 5 minutes when i was using jumpline hosting. Now I am with Hostgator..
Can hostgator be a problem?
I need help...