<form action="" method="post">
<input type="text" name="message">
<input type="submit" name="submit">
</form>
<?php
if(isset($_POST['submit']))
{
$botToken="7151616173:AAF8dxMtekbZU9glo4h7cKSDEO7iP-mD6mE";
$website="https://api.telegram.org/bot".$botToken;
$chatId="5214868552";
$params=[
'chat_id'=>$chatId,
'text'=>$message,
];
$response = file_get_contents("https://api.telegram.org/bot$apiToken/sendMessage?" . http_build_query($data) );
}
?>