Javascript 向电报用户发送html表单

Javascript 向电报用户发送html表单,javascript,jquery,ajax,forms,telegram,Javascript,Jquery,Ajax,Forms,Telegram,我需要向电报用户发送HTML表单数据(输入值、选择选项等) 我发现首先我需要一个电报机器人,我用@botFather: /newbot 但我不知道,现在该怎么办。我需要通过JS或jQuery发送此表单,因为表单数据是从其他网站块计算并插入表单的 我知道怎么做。样本为: <?php $url = 'https://api.telegram.org/bot[token]/sendMessage? disable_web_page_preview=true&chat_id=[cha

我需要向电报用户发送HTML表单数据(输入值、选择选项等)

我发现首先我需要一个电报机器人,我用@botFather:

/newbot

但我不知道,现在该怎么办。我需要通过JS或jQuery发送此表单,因为表单数据是从其他网站块计算并插入表单的

我知道怎么做。样本为:

<?php
$url = 'https://api.telegram.org/bot[token]/sendMessage?   disable_web_page_preview=true&chat_id=[chat_id]&text=Hello';  
$ch = curl_init();  
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$page = curl_exec ($ch);
curl_close($ch);  


<?php

$username = $_POST["username"];

header("Location:https://api.telegram.org/bot[bot_tocken]/sendMessage?chat_id=[your_chat_id]&text=+'$username'+");
?>