title: Refilling drop down menu selection after form submission validation
body: <p>I'm working on a sign up/registration form in php that resubmits/retains the users input if everything doesn't validate properly. I've got text box, password input, and radio buttons all working but these drop down menus have been more trouble. The php code I used works for the text boxes but not these select/options, is there a better way to do this? I've cut out the majority of the options just to save space, but each goes from 0-11 months, 1-31 days, and 1900-2013 years respectively.</p>
  
  <pre><code>&lt;select id="month" name="month" value="&lt;?php
      if(isset($_POST['month']))
          echo htmlspecialchars($_POST['month'])?&gt;"&gt;
  
      &lt;option value="default"&gt;Month&lt;/option&gt;
      &lt;option value="0"&gt;January&lt;/option&gt;
      ...
      &lt;option value="11"&gt;December&lt;/option&gt;
  
  &lt;/select&gt;
  &lt;select id="formDay" name="day" value="&lt;?php
      if(isset($_POST['day']))
          echo htmlspecialchars($_POST['day'])?&gt;"&gt;
  
      &lt;option value="default"&gt;Day&lt;/option&gt;
      &lt;option value="1"&gt;1&lt;/option&gt;
      ...
      &lt;option value="31"&gt;31&lt;/option&gt;
  
  &lt;/select&gt;
  &lt;select id="formYear" name="year" value="&lt;?php
      if(isset($_POST['year']))
          echo htmlspecialchars($_POST['year'])?&gt;"&gt;
  
      &lt;option value="default"&gt;Year&lt;/option&gt;
      &lt;option value="2013"&gt;2013&lt;/option&gt;
      ...
      &lt;option value="1900"&gt;1900&lt;/option&gt;
  
   &lt;/select&gt;                    
  </code></pre>