title: PHP - return back to HTML form
body: <p>Going to call mail within PHP server code then return back to HTML page.
  Wrote the following server code:</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;HEAD&gt;
      &lt;META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"&gt;
  &lt;/HEAD&gt;
  &lt;BODY&gt;
      &lt;?php
      $referer = filter_input(INPUT_SERVER, 'HTTP_REFERER');  // real referrer detected
      // do something or nothing
      header("Location: $referer");
      ?&gt;
  &lt;/BODY&gt;
  </code></pre>
  
  <p>This code produce an error "<strong>Warning: Cannot modify header information - headers already sent by...</strong>".
  Why?</p>