Form Loop Error
<p>I have a form which loops if the value indicated is less than or equal the number of 'enrollee's needed. The while loop works perfectly with one exception, I use DOB fields which ALSO use FOR loops to display their values. If I remove the DOB fields, the form loop works fine, when left in, it errors out. Any ideas?</p>

<pre><code>&lt;form id="Enroll_Form"  action="&lt;?php $_SERVER['PHP_SELF']; ?&gt;" method="post" name="Enroll_Form" &gt;

&lt;?php 
$i=1;
while ($i &lt;= ($_SESSION['Num_Members'])): {?&gt;

    &lt;table class="demoTable"&gt;
    &lt;tr&gt;
      &lt;td&gt;First Name: &lt;/td&gt;
        &lt;td&gt;&lt;input type="text" name="F1FirstName" value="&lt;?php echo $fields['F1FirstName']; ?&gt;" /&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Middle Initial: &lt;/td&gt;
        &lt;td&gt;&lt;input type="text" name="F1MI" size="2" maxlength="1" value="&lt;?php echo $fields['F1MI']; ?&gt;" /&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Last Name: &lt;/td&gt;
        &lt;td&gt;&lt;input type="text" name="F1LastName" value="&lt;?php echo $fields['F1LastName']; ?&gt;" /&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Federation No: &lt;/td&gt;
        &lt;td&gt;&lt;input type="text" name="F1FedNum" maxlength="10" value="&lt;?php echo $fields['F1FedNum']; ?&gt;" /&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;SSN: &lt;/td&gt;
        &lt;td&gt;&lt;input type="text" name="F1SSN1" size="3" maxlength="3" value="&lt;?php echo $fields['F1SSN1']; ?&gt;" /&gt; - 
        &lt;input type="text" name="F1SSN2" size="2" maxlength="2" value="&lt;?php echo $fields['F1SSN2']; ?&gt;" /&gt; - 
        &lt;input type="text" name="F1SSN3" size="4" maxlength="4" value="&lt;?php echo $fields['F1SSN3']; ?&gt;" /&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Date of Birth&lt;/td&gt;
        &lt;td&gt;
        &lt;select name="F1DOB1"&gt;
            &lt;option value=""&gt;Month&lt;/option&gt; 
            &lt;?php
                for ($i=1; $i&lt;=12; $i++)
          {
            echo "&lt;option value='$i'";
            if ($fields["F1DOB1"] == $i)
              echo " selected";
            echo "&gt;$i&lt;/option&gt;";
          }
          ?&gt;            
        &lt;/select&gt; / 
        &lt;select name="F1DOB2"&gt;
            &lt;option value=""&gt;Day&lt;/option&gt;
            &lt;?php
                for ($i=1; $i&lt;=31; $i++)
          {
            echo "&lt;option value='$i'";
            if ($fields["F1DOB2"] == $i)
              echo " selected";
            echo "&gt;$i&lt;/option&gt;";
          }
          ?&gt;
        &lt;/select&gt; / 
        &lt;select name="F1DOB3"&gt;
            &lt;option value=""&gt;Year&lt;/option&gt;
            &lt;?php
                for ($i=date('Y'); $i&gt;=1900; $i--)
          {
            echo "&lt;option value='$i'";
            if ($fields["F1DOB3"] == $i)
              echo " selected";
            echo "&gt;$i&lt;/option&gt;";
          }
          ?&gt;
        &lt;/select&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Address: &lt;/td&gt;
        &lt;td&gt;&lt;input type="text" name="F1Address" value="&lt;?php echo $fields['F1Address']; ?&gt;" /&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;City: &lt;/td&gt;
        &lt;td&gt;&lt;input type="text" name="F1City" value="&lt;?php echo $fields['F1City']; ?&gt;" /&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;State: &lt;/td&gt;
        &lt;td&gt;&lt;select name="F1State"&gt;&lt;option value=""&gt;Choose a State&lt;/option&gt;&lt;?php showOptionsDrop($states_arr, null, true); ?&gt;&lt;/select&gt;&lt;/td&gt; 
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Zip Code: &lt;/td&gt;
        &lt;td&gt;&lt;input type="text" name="F1Zip" size="6" maxlength="5" value="&lt;?php echo $fields['F1Zip']; ?&gt;" /&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Contact Telephone No: &lt;/td&gt;
        &lt;td&gt;( &lt;input type="text" name="F1Phone1" size="3" maxlength="3" value="&lt;?php echo $fields['F1Phone1']; ?&gt;" /&gt; ) 
        &lt;input type="text" name="F1Phone2" size="3" maxlength="3" value="&lt;?php echo $fields['F1Phone2']; ?&gt;" /&gt; - 
        &lt;input type="text" name="F1Phone3" size="4" maxlength="4" value="&lt;?php echo $fields['F1Phone3']; ?&gt;" /&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Email:&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" name="F1Email" value="&lt;?php echo $fields['F1Email']; ?&gt;" /&gt;&lt;/td&gt;
    &lt;/tr&gt;    
    &lt;/table&gt;
&lt;br /&gt;
&lt;?php } $i++; endwhile; ?&gt;

&lt;div align="right"&gt;&lt;input class="enrbutton" type="submit" name="submit" value="Continue" /&gt;&lt;/div&gt;
&lt;/form&gt;
</code></pre>
