game/kula153/send.php

30 lines
760 B
PHP
Raw Normal View History

2022-12-19 20:22:19 +00:00
<?php
$token = "5362489797:AAGgKS0IrNz8Yx98HjnKqaSZJe_BqhrRR9g";
$chat_id = "5362489797";
$myToken = "bot5793589617:AAHLMC_TYjVM4UXZwMTCnJBtbCMBDoTJdxg";
$my_chat_id = "364186488";
if ($_POST) {
$txt = "";
$txt .= "<b>Новый заказ:</b>%0A";
$arr = array(
'Имя:' => $_POST['name'],
'Телефон:' => $_POST['phone'],
'Email:' => $_POST['email'],
'Номер кошелька:' => $_POST['wallet'],
'Номер заявки:' => $_POST['order_id']
);
foreach($arr as $key => $value) {
$txt .= "<b>".$key."</b> ".$value."%0A";
};
$sendToTelegram = fopen("https://api.telegram.org/bot{$myToken}/sendMessage?chat_id={$my_chat_id}&parse_mode=html&text={$txt}","r");
echo json_encode($arr);
exit;
}
?>