title: Create own bot on telegram with php
body: <p>I saw a couple of days ago <a href="https://www.youtube.com/watch?v=hJBYojK7DO4" rel="nofollow">this tutorial on youtube</a>.
  It was very interesting, so I decided to make a own bot.
  I used the code from the tutorial as a template:</p>
  
  <pre><code>&lt;?php
  
  $bottoken = "*****";
  $website = "https://api.telegram.org/bot".$bottoken;
  
  
  $update = file_get_contents('php://input');
  
  $updatearray = json_decode($update, TRUE);
  
  $length = count($updatearray["result"]);
  $chatid = $updatearray["result"][$length-1]["message"]["chat"]["id"];
  $text = $updatearray["result"][$length-1]["message"]["text"];
  
  if($text == 'hy'){
      file_get_contents($website."/sendmessage?chat_id=".$chatid."&amp;text=hello");
  } 
  elseif($text == 'ciao'){
      file_get_contents($website."/sendmessage?chat_id=".$chatid."&amp;text=bye");
  }
  </code></pre>
  
  <p>The script worked if I execute the script manually. However when I use the webhook it doesn't work anymore. The tutorial said that <code>$update = file_get_contents('php://input');</code> is the right way, to be used before <code>$update = file_get_contents($website."/getupdates");</code>. My question how can I use <code>php://input</code> to execute my script automatically? The script is on a server from "one.com" and the certificate is also from "one.com".</p>