title: PHP - How to display POST data received in a HTML page
body: <p>I have a simple HTML page (let's call it Page H) and it's hosted on a remote server. This page has been configured to allow for cross-origin requests.</p>
  
  <p>Now, I would like to do the following:</p>
  
  <ol>
  <li>From localhost (or otherwise), use <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API" rel="nofollow noreferrer">fetch API</a> to send a POST request containing some data to Page H</li>
  <li>Upon receiving the POST request, the HTML page should display the information sent in the POST request</li>
  </ol>
  
  <p>The page is really simple right now, with only HTML and some basic PHP. Is there a way to accomplish what I want without involving a database? I saw <a href="https://stackoverflow.com/questions/38999552/update-webpage-after-receiving-post-request">this similar question</a> but the answer is not quite satisfactory...</p>
  
  <p>Edit:</p>
  
  <p>The basic HTML (which is hosted on a remote server):</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;/head&gt; 
  &lt;body&gt; 
      &lt;h1&gt;Hello World!&lt;/h1&gt; 
  &lt;/body&gt; 
  &lt;/html&gt;
  </code></pre>
  
  <p>The <code>Fetch API</code> request (sent from some other random place, like my own computer):</p>
  
  <pre><code>fetch('./test.txt') // getting data from a text file
    .then(function(response){
      return response.text(); 
    })
    .then(function(data){ 
      console.log(data); 
  
    fetch('&lt;WEBSITE_FOR_HTML_PAGE&gt;', { 
     method: 'POST',
     body: data
    })
    .then(function (response) { // I don't care about the response
    })  
    .catch(function (error) {  
     console.log('Request failure: ', error);  
    });
    })
  </code></pre>
  
  <p>So I want the HTML page to display the data sent using the <code>Fetch API</code>...</p>