Line 1122 in /home/developer/web/xaviermarks.com/public_html/mysite/code/CT.php
1113 static function getCountryFromIP() { 1114 $ip = ''; 1115 if (isset($_SERVER['HTTP_CLIENT_IP'])) { 1116 $ip = $_SERVER['HTTP_CLIENT_IP']; 1117 } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { 1118 $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; 1119 } elseif (isset($_SERVER['REMOTE_ADDR'])) { 1120 $ip = $_SERVER['REMOTE_ADDR']; 1121 } 1122 $geoInfo = file_get_contents("https://api.ipbase.com/v1/json/{$ip}"); 1123 $geoData = json_decode($geoInfo); 1124 1125 if (isset($geoData->country_code)) { 1126 $country = $geoData->country_code; 1127 } else { 1128 $country = 'unknown';