So I finished hosting my website on cpanel, but one of the functions to send messages via Telegram API is not working. I tested with a new file and sure enough it didn’t work.
<?php
$url = "https://api.telegram.org/bot$botToken/sendMessage?parse_mode=markdown&chat_id=$chatId&text=Hello%20hehe";
file_get_contents($url);
?>
Is it really not possible to do http-request in cpanel?
- I’ve tried it on my localhost and it works.
- Telegram bot is pre-initialized with any message
New contributor
Yefta Asyel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.