include("geoip/geoip.inc"); // include the geoip functions
$geofile = geoip_open("GeoIP.dat",GEOIP_STANDARD); // open the geoip data file
$cc = geoip_country_code_by_addr($geofile, $_SERVER['REMOTE_ADDR']);
geoip_close($geofile); // close the data file
if($cc == "US") {
// It’s a US visitor. Display the US ad here.
echo "US ad code goes here.";
} // end if US
?>







