Is there a script of a simple form of communication?

Hello!
Please tell me the simple script of the form of the order call. Just need two fields and a submit button. Without fesikov and so on.
You do not have enough knowledge to implement.

thank you!
August 19th 19 at 23:35
1 answer
August 19th 19 at 23:37
pulled from here =) www.avtomilia.ru simple form of communication , the message refers to telegrams in this script:
<?
function sendMessage($chatID, $messaggio, $token) {
 //echo "sending message to" . $chatID . "\n";


 $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);
curl_close($ch);
}
?>

if ( (isset($_POST['tel']) ) && ($_POST['tel']!=") ) {
$name=$_POST['name'];
$tel=$_POST['tel'];
 //echo "name = $name<br>tel=$tel<br>";
 sendMessage($chatid,"call me $tel ($name)", $token);
 header('Location: http://avtomilia.ru/?send=tnx');
exit;
} else {
 header('Location: http://avtomilia.ru');
exit;
}
thank you! but if you want the message sent to email? :) - archibald.Ry commented on August 19th 19 at 23:40
: colcheste themselves =) but I suggest to still use the telegram , much easier =) instant reaction is a huge plus =) - Verona.Armstrong commented on August 19th 19 at 23:43
in the script there is no protection from XSS attacks - terence.Hermann commented on August 19th 19 at 23:46
: I know =) but in theory there that it is difficult to bungle - Verona.Armstrong commented on August 19th 19 at 23:49
where offer to take $chat_id and $token? - Verna.Pagac82 commented on August 19th 19 at 23:52
from config.py =) token is token bot when you register in the telegram, bot @BotFather
and catid is the user ID (or chat) , remember when you first access the bot user. - Verona.Armstrong commented on August 19th 19 at 23:55

Find more questions by tags PHP