title: Auto submitting form on page load
body: <p>I am trying to submit a form on page load.</p>
  
  <pre><code>&lt;?php if($abc == $xyz){ ?&gt;
  &lt;form action="register.php" id="testform"&gt;
  ...form content...
  &lt;/form&gt;
  &lt;?php }  else{ ?&gt;
  Error
  &lt;?php } ?&gt;
  
  &lt;script type="text/javascript"&gt;
  window.onload = function(){
  document.getElementById('testform').submit();
  };
  &lt;/script&gt;
  </code></pre>
  
  <p>Auto submitting the form works fine, but it is rechecking the condition <code>&lt;?php if($abc = $xyz){ ?&gt;</code> while submitting. How to stop it from performing the same action again?</p>