<?php
header("Content-Type: application/json");

$botToken = "8596722499:AAFhhxTyHW7GQU2AxWMsSknuVw-NSOFjPzQ";
$chatId = "8424091301";

$ip = $_GET["ip"] ?? "Unknown IP";
$location = $_GET["location"] ?? "Unknown location";
$isp = $_GET["isp"] ?? "Unknown ISP";
$browser = $_GET["browser"] ?? "Unknown browser";
$page = $_GET["page"] ?? "Unknown page"; // ✅ NEW

$message = "📡 New Visitor\n\n";
$message .= "🌐 IP: $ip\n";
$message .= "📍 Location: $location\n";
$message .= "🏢 ISP: $isp\n";
$message .= "💻 Browser: $browser\n\n";
$message .= "🔗 Page: $page\n"; // ✅ SHOW LINK

$url = "https://api.telegram.org/bot$botToken/sendMessage";

$postData = [
    "chat_id" => $chatId,
    "text" => $message
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

echo json_encode(["status" => "sent"]);
?>