<?php
header('Content-type: application/json');
$token = "bot463504725:AAHfhNNz_aJA4iqj59Sa0Nx5EVravRMX8k";
$chatid = "-27277101";
$title = $_POST['title'];
$name = $_POST['name'];
$phone = $_POST['phone'];
$mes = $_POST['text'];
$mes2 = $_POST['text2'];
$ip = $_SERVER['REMOTE_ADDR'];
// print_r($_POST);
$msgs =
' '.$title.'
Имя: '.$name.'
☎️ '.$phone.'
Сообщение: '.$mes.'
IP: '.$ip.'
'.$mes2.'';
$messaggio = date('H:i').'
'.$msgs;
$url = "https://api.telegram.org/" . $token . "/sendMessage?chat_id=" . $chatid;
$url = $url . "&text=" . urlencode($messaggio);
$ch = curl_init();
$optArray = array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true
);
curl_setopt_array($ch, $optArray);
$result = curl_exec($ch);
echo json_encode(['status' => 'success']);
// echo "1";
?>