<?php
// Telegram Bot Token
$botToken = '7701439773:AAEWk1o6Jhe0znSvEjRj1fDxbTOO8XhRZmI';

// Telegram User ID (Recipient)
$chatId = '6177108754';

// Message to send
$message = "Hello! This is a test message from my PHP script.";

// Telegram API URL
$apiUrl = "https://api.telegram.org/bot$botToken/sendMessage";

// Data to send via POST
$data = [
    'chat_id' => $chatId,
    'text' => $message
];

// Initialize cURL
$ch = curl_init($apiUrl);

// Set cURL options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

// Execute cURL and get the response
$response = curl_exec($ch);

// Check for errors
if ($response === false) {
    echo "Error sending message: " . curl_error($ch);
} else {
    echo "Message sent successfully: $response";
}

// Close cURL
curl_close($ch);
?>
