require_once('/home/freegif2/public_html/geo/geoip.inc'); $gi = geoip_open('/home/freegif2/public_html/geo/GeoIP.dat', GEOIP_MEMORY_CACHE); $country = geoip_country_code_by_addr($gi, $_SERVER['REMOTE_ADDR']); geoip_close($gi); // this shows something to India and Philippines if ($country == 'IN' || $country == 'PH') { echo "http://google.com"; } // this shows something to United Kingdom elseif ($country == 'GB') { echo "http://google.fr"; } // all other countries else { echo "http://youtube.com"; }