title: How to remember posted fields in forms for drop down items?
body: <p>I'm creating a simple registration page:</p>
  
  <pre><code>&lt;?php
      $firstName = $_POST['firstName'];
  ?&gt;
  
  &lt;form action="registration.php" method="post" enctype="multipart/form-data"&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;b&gt;First name:&lt;/b&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input type="text" name="firstName" size="30" maxlength="400" value="&lt;?php echo $firstName; ?&gt;" /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;input type="submit" value="Submit" /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
  
      &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>If the user enters an invalid first name (ex. too short, or weird symbols), the page reloads with an error message shows up to tell them that they have to re-enter their name HOWEVER, the value of the text field is what they most recently entered.  This way whenever a user doesn't pass validation, they don't have to re-enter all the fields in the form.</p>
  
  <p>What's a good way to remember what the user entered for a drop down menu?  The problem for me is that the option value is different than the text inside the option tag.  So when I use the above approach, if I select "Mar" if in invalid submission occurs, '03' appears in the dropdown menu.</p>
  
  <pre><code>    &lt;select name="birthdayMonth"&gt;
          &lt;option value="-1"&gt;Month:&lt;/option&gt;
          &lt;option value="01"&gt;Jan&lt;/option&gt;
          &lt;option value="02"&gt;Feb&lt;/option&gt;
          &lt;option value="03"&gt;Mar&lt;/option&gt;
          &lt;option value="04"&gt;Apr&lt;/option&gt;
          &lt;option value="05"&gt;May&lt;/option&gt;
          &lt;option value="06"&gt;Jun&lt;/option&gt;
          &lt;option value="07"&gt;Jul&lt;/option&gt;
          &lt;option value="08"&gt;Aug&lt;/option&gt;
          &lt;option value="09"&gt;Sep&lt;/option&gt;
          &lt;option value="10"&gt;Oct&lt;/option&gt;
          &lt;option value="11"&gt;Nov&lt;/option&gt;
          &lt;option value="12"&gt;Dec&lt;/option&gt;
      &lt;/select&gt;
  </code></pre>