0

i get an error in my php source...(im not master of 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);

and My Error :

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

how can i fix it :(

Saeed
  • 1
  • 2

1 Answers1

0

You are defining the $API_KEY, $chatid, $from_id2 after using it.

Try this with the correct 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);
Fawzan
  • 4,738
  • 8
  • 41
  • 85