title: file_get_contents(https://api.telegram.org/bot failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request in telegram.php on line 49
body: <p>I use this code in index.php page</p>
  
  <pre><code>function get_model_info($model)
          {
             $query="select * from mobile where model_name='".$model."' limit 1";
  
                return $query;
  
                }
          // $telegram = null;
          $query=get_model_info($text);
          $telegram-&gt;query=$query;
           $telegram-&gt;runqury();
           $result=$telegram-&gt;queryresult;
           $text=urlencode($result-&gt;fetch_object()-&gt;info);
  
       $telegram-&gt;sendmessage($userid, $text);
  </code></pre>
  
  <p>and used this code on telegram.php page</p>
  
  <pre><code>public function sendmessage($userid,$text)
    {
      $url='https://api.telegram.org/bot'.$this-&gt;token.'/sendmessage?chat_id='.$userid.'&amp;text='.$text;
         file_get_contents($url);
       }
  </code></pre>
  
  <p>but it doesn't work.</p>