【问题标题】:failed to open stream in my php source无法在我的 php 源中打开流
【发布时间】:2018-02-27 19:25:39
【问题描述】:

我的 php 源代码出错...(我不是 php 大师)

    $API_KEY = '246010911:AAFVhj7jc4kXUPfBH1**************';
$chatid = $update->callback_query->message->chat->id;
$from_id2 = $update->callback_query->from->id;
$get1 = file_get_contents("https://api.telegram.org/bot$API_KEY/getChatMember?chat_id=$chatid&user_id=".$from_id2);

和我的错误:

PHP Warning:  file_get_contents(https://api.telegram.org/bot****/getChatMember?chat_id=&user_id=): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request

我该如何解决它:(

【问题讨论】:

    标签: bots telegram telegram-bot php-telegram-bot


    【解决方案1】:

    您在使用后定义$API_KEY$chatid$from_id2

    尝试使用正确的 API_KEY。

    $API_KEY = '246010911:AAFVhj7jc4kXUPfBH1**************';
    $chatid = $update->callback_query->message->chat->id;
    $from_id2 = $update->callback_query->from->id;
    
    $get1 = file_get_contents("https://api.telegram.org/bot$API_KEY/getChatMember?chat_id=$chatid&user_id=".$from_id2);
    

    【讨论】:

    • 同样的警告?可以分享截图吗?
    猜你喜欢
    • 1970-01-01
    • 2019-12-03
    • 2012-05-14
    • 2020-07-27
    • 2012-08-04
    • 1970-01-01
    • 2018-01-13
    • 2018-11-21
    相关资源
    最近更新 更多