title: Telegram webhook php bot doesn't answer
body: <p>I'm trying to set up a telegram bot with a webhook. I can get it to work with getUpdates, but I want it to work with a webhook.</p>
  
  <p>My site (that hosts the bot php script) has the SSL certificate working (I get the green lock in the address bar):</p>
  
  <p>I set up the webhook with</p>
  
  <pre><code>https://api.telegram.org/bot&lt;token&gt;/setwebhook?url=https://www.example.com/bot/bot.php
  </code></pre>
  
  <p>And I got: {"ok":true,"result":true,"description":"Webhook was set"}</p>
  
  <p>(I don't know if this matters, but I have given rwx rights to both the folder and the script)</p>
  
  <p>The php bot: (<a href="https://www.example.com/bot/bot.php" rel="nofollow">https://www.example.com/bot/bot.php</a>)</p>
  
  <pre><code>&lt;?php
  
  $botToken = &lt;token&gt;;
  $website = "https://api.telegram.org/bot".$botToken;
  
  #$update = url_get_contents('php://input');
  $update = file_get_contents('php://input');
  $update = json_decode($update, TRUE);
  
  $chatId = $update["message"]["chat"]["id"];
  $message = $update["message"]["text"];
  
  switch($message) {
      case "/test":
          sendMessage($chatId, "test");
          break;
      case "/hi":
          sendMessage($chatId, "hi there!");
          break;
      default:
          sendMessage($chatId, "default");
  }
  
  function sendMessage ($chatId, $message) {
      $url = $GLOBALS[website]."/sendMessage?chat_id=".$chatId."&amp;text=".urlencode($message);
      url_get_contents($url);
  
  }
  
  function url_get_contents($Url) {
      if(!function_exists('curl_init')) {
          die('CURL is not installed!');
      }
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, $Url);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      $output = curl_exec($ch);
      curl_close($ch);
      return $output;
  }
  
  ?&gt;
  </code></pre>
  
  <p>But when I write anything to the bot I receive no answers...</p>
  
  <p>Any ideas why?</p>
  
  <p>Thanks</p>