title: Send POST data to PHP without using an HTML form?
body: <p>Is there anyway to send post data to a php script other than having a form? (Not using GET of course).</p>
  
  <p>I want javascript to reload the page after X seconds and post some data to the page at the same time. I could do it with GET but I would rather use POST, as it looks cleaner. </p>
  
  <p>Thanks a lot. </p>
  
  <p>EDIT: Would it be possible to do with PHP header? I'm sure it is better to use JQuery but for my current situation I could implement that a lot easier/faster : )</p>
  
  <p>Cheers</p>
  
  <p>I ended up doing it like so:</p>
  
  <pre><code>&lt;script&gt;
    function mySubmit() {
      var form = document.forms.myForm;
      form.submit();
    }
  &lt;/script&gt;
  
  ...
  
  &lt;body onLoad="mySubmit()";&gt;
    &lt;form action="script.php?GET_Value=&lt;?php echo $GET_var ?&gt;" name="myForm" method="post"&gt;
      &lt;input type="hidden" name="POST_Value" value="&lt;?php echo $POST_Var ?&gt;"&gt;
    &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>Seems to work fine for me, but please say if there is anything wrong with it!</p>
  
  <p>Thanks everyone.</p>