I'm populating a form using PHP, how do I make the select list sticky?
<p>I am using the code below to populate a select list from fields in a db and it works great, the problem is how do I make it sticky? if the user types in the wrong info the page reloads and it does not remember what was selected from the list. </p>

<p>I have tried a few different if statements but i couldn't get it working. The list populates with 15 customer names, what would be the best way to tackle this? Thanks</p>

<pre><code>&lt;fieldset&gt;
        &lt;legend&gt;&lt;b&gt;Check to see how many times a user has logged in&lt;/b&gt;&lt;/legend&gt;
        &lt;p&gt;&lt;label for="fname"&gt;First Name:&lt;/label&gt;&lt;input type="text" id="fname" name="fname" value="&lt;?php if (!empty($fname)) echo $fname; ?&gt;" /&gt;&lt;/p&gt;
      &lt;p&gt;&lt;label for="lname"&gt;Last Name:&lt;/label&gt;&lt;input type="text" id="lname" name="lname" value="&lt;?php if (!empty($lname)) echo $lname; ?&gt;" /&gt;&lt;/p&gt;
      &lt;p&gt;&lt;label for="customer"&gt;Customers:&lt;/label&gt;
          &lt;select name="customer"&gt;
                &lt;?php
                    $custNames = getCustomers();
                    foreach($custNames as $customers){
                        echo '&lt;option value="' . $customers . '"&gt;' . $customers . '&lt;/option&gt;';
                    }
                ?&gt;
            &lt;/select&gt;
        &lt;/p&gt;
      &lt;p class="submit"&gt;&lt;input type="submit" value="See Logins" name="submit" /&gt;&lt;/p&gt;
  &lt;/fieldset&gt;
</code></pre>
