title: PHP Redirection with Post Parameters
body: <p>I have a webpage. This webpage redirects the user to another webpage, more or less the following way:</p>
  
  <pre><code>&lt;form method="post" action="anotherpage.php" id="myform"&gt;
  
      &lt;?php foreach($_GET as $key =&gt; $value){
      echo "&lt;input type='hidden' name='{$key}' value='{$value}' /&gt;";
      } ?&gt;
  
  &lt;/form&gt;
  &lt;script&gt;
  
      document.getElementById('myform').submit();
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Well, you see, what I do is transferring the GET params into POST params. Do not tell me it is bad, I know that myself, and it is not exactly what I really do, what is important is that I collect data from an array and try submitting it to another page via POST. But if the user has JavaScript turned off, it won't work. What I need to know: Is there a way to transfer POST parameters by means of PHP so the redirection can be done the PHP way (<code>header('Location: anotherpage.php');</code>), too?</p>
  
  <p>It is very important for me to pass the params via POST. I cannot use the $_SESSION variable because the webpage is on another domain, thus, the $_SESSION variables differ.</p>
  
  <p>Anyway, I simply need a way to transfer POST variables with PHP ^^</p>
  
  <p>Thanks in advance!</p>