if (!isset($_COOKIE[COOKIE_PREFIX . 'GeoIP'])){ // put geo locating code here include('./geoip.php'); $countryCode = getCountryCode($_SERVER['REMOTE_ADDR']); // set cookie vbsetcookie('GeoIP', $countryCode, permanent);}else{ $countryCode = $_COOKIE[COOKIE_PREFIX . 'GeoIP'];}