title: Missing POST data (occasionally)
body: <p>Sometimes an HTML form is failing to submit any POST data.</p>
  
  <p>There is nothing wrong with the form itself, the exact same form is submitted hundreds of times a day without any problems.</p>
  
  <p>This error came about when a user complained about the functionality of my site. To try and work out the problem I added some email alerts which give me a copy of the <code>$_GET</code>, <code>$_POST</code>, <code>$_SESSION</code> and <code>$_SERVER</code> arrays. From this I found out that the <code>$_POST</code> data was empty.</p>
  
  <p>My first thought was some weird browser issue but the database running behind the site shows that the very same user, running the very same browser successfully submitted the form within a couple of minutes of the error.</p>
  
  <p>It might be coincidence but this always happens on Safari. It has happened a couple of times on Safari 5.1.9 and once on Mobile Safari 7.0.</p>
  
  <p>Thanks for any help.</p>
  
  <hr>
  
  <p>Some updates in response to some comments:</p>
  
  <ol>
  <li>There is no validation used with the form (assuming you mean something like <a href="http://jqueryvalidation.org/" rel="nofollow">jQuery Validation</a>).</li>
  <li>I am not using any Ajax.</li>
  <li>The following is the HTML form (with some formatting stuff removed) and a snippet of the PHP script. Although, like I said, I am pretty sure this isn't the problem because I have the same form used by the same user, browser and device without any problems (within minutes of the fault).</li>
  </ol>
  
  <p>The HTML form (basically the user is given ten numbers and they have to input ten numbers):
      </p>
  
  <pre><code>    &lt;input type="hidden" name="type" value="329"/&gt;
      &lt;input type="hidden" name="code" value="0"/&gt;    
  
      &lt;input type="hidden" name="start[]" value="2"/&gt;
      &lt;input type="hidden" name="start[]" value="5"/&gt;
      &lt;input type="hidden" name="start[]" value="8"/&gt;
      &lt;input type="hidden" name="start[]" value="1"/&gt;
      &lt;input type="hidden" name="start[]" value="3"/&gt;
      &lt;input type="hidden" name="start[]" value="9"/&gt;
      &lt;input type="hidden" name="start[]" value="6"/&gt;
      &lt;input type="hidden" name="start[]" value="10"/&gt;
      &lt;input type="hidden" name="start[]" value="4"/&gt;
      &lt;input type="hidden" name="start[]" value="7"/&gt;
  
      &lt;input type="number" name="input[]" maxlength=4 autocomplete="off" step="any" min="0"/&gt;
      &lt;input type="number" name="input[]" maxlength=4 autocomplete="off" step="any" min="0"/&gt;
      &lt;input type="number" name="input[]" maxlength=4 autocomplete="off" step="any" min="0"/&gt;
      &lt;input type="number" name="input[]" maxlength=4 autocomplete="off" step="any" min="0"/&gt;
      &lt;input type="number" name="input[]" maxlength=4 autocomplete="off" step="any" min="0"/&gt;
      &lt;input type="number" name="input[]" maxlength=4 autocomplete="off" step="any" min="0"/&gt;
      &lt;input type="number" name="input[]" maxlength=4 autocomplete="off" step="any" min="0"/&gt;
      &lt;input type="number" name="input[]" maxlength=4 autocomplete="off" step="any" min="0"/&gt;
      &lt;input type="number" name="input[]" maxlength=4 autocomplete="off" step="any" min="0"/&gt;
      &lt;input type="number" name="input[]" maxlength=4 autocomplete="off" step="any" min="0"/&gt;
  
      &lt;input type="submit" value="Finish"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And the PHP file:</p>
  
  <pre><code>//First check the user is logged in
  if(isset($_SESSION['user_id'])){
      //Check for the POST data
      if(!isset($_POST['type'])){
          //No post data - why?!
      }
      //Do stuff...
  }
  </code></pre>
  
  <p>Hope this clears up a few things</p>