if (! function_exists ( 'geoip_open' )) require_once 'geoip.inc'; $gf = GEOIP_STANDARD; $gh = geoip_open ( 'GeoIP.dat', $gf ); $c = geoip_country_code_by_addr ( $gh, $_SERVER ['REMOTE_ADDR'] );