Answer the question
In order to leave comments, you need to log in
Sends a request locally, but not on the Internet?
Sends an application on the local, but not on the Internet.
Error appears on the Internet, everything is fine on the local, why?
Help! Very necessary! Thanks in advance!
<?php
$name = $_POST['fio'];
$phone = $_POST['phone'];
$token = "630683258:AAF18XQlE2SFVid3y4P7yGvqJxMFvyjQUM4";
$chat_id = "-361496163";
$arr = array(
'Ф.И.О.: ' => $name,
'Телефон: ' => $phone,
);
foreach($arr as $key => $value) {
$txt .= "<b>".$key."</b> ".$value."%0A";
};
$sendToTelegram = fopen("https://api.telegram.org/bot{$token}/sendMessage?chat_id={$chat_id}&parse_mode=html&text={$txt}","r");
if ($sendToTelegram) {
header('Location: thank-you.html');
} else {
echo "Error";
}
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question