skip to Main Content

upload photo and text from form input and sending to telegram bot with php – Telegram API

html code: <form action="process.php"> <input type="text" name="name"> <input type="file" name="photo"> <input type="submit" value="Submit"> </form> process.php: define ('url',"https://api.telegram.org/bot****/"); $name = $_GET['name']; $img=$_FILES['photo']['name']; $chat_id = '****'; $message = urlencode("Name:".$name); file_get_contents(url."sendmessage?text=".$message."&chat_id=".$chat_id."&parse_mode=HTML"); I recieve text message but photo not. I don't know how to…

VIEW QUESTION
Back To Top
Search