title: Waning: Undefined array key when trying to store post variables (xmlhttprequest)
body: <p>I'm trying to save the data that &quot;buchen.php&quot; get in php variables but I keep getting the following error</p>
  <p><strong>Warning:</strong> Undefined array key &quot;reise_id&quot; in buchen.php on line 4</p>
  <p><strong>Warning:</strong> Undefined array key &quot;platz_geb&quot; in buchen.php on line 5</p>
  <p>Can anyone tell what could be wrong here?</p>
  <pre><code>    var xhr = new XMLHttpRequest();
      xhr.open('POST', 'buchen.php');
      xhr.setRequestHeader('Content-Type', 'application/json');
      xhr.send(JSON.stringify({
          reise_id: &quot;&lt;?php echo $reise_id; ?&gt;&quot;,
          platz_geb: platz_blau
      }));
  </code></pre>
  <pre><code>//buchen.php
  
      $reise_id = $_POST['reise_id'];
      $platz_geb = $_POST['platz_geb'];
  </code></pre>