title: PHP for each drop down selected
body: <p>I got this piece of code here...</p>
  
  <pre><code>&lt;form action="InvoiceNotice.php?action=invoicenotice" method="post"&gt;
  &lt;label for="fordays"&gt;Select Day&lt;/label&gt;
  &lt;select name="daySelected" id="daySelected"&gt;
  &lt;option value="0"&gt;Today&lt;/option&gt;
  &lt;?php
  $array = array_combine(range(1,$InvoiceDaysArray['days']), range(1,$InvoiceDaysArray['days']));
  foreach($array as $row =&gt; $value){
      $selected = '';
      $daySelected = 0;
      if($daySelected == $row){
      $selected = 'SELECTED';
      }
      echo "&lt;option selected='" . $selected . "' value='" . $row . "'&gt;" . $value . " days ago&lt;/option&gt;";
  }
  ?&gt;
  &lt;/select&gt;
  &lt;input type="submit" name="button" id="button" value="Submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>My issue is with the <code>$selected</code> the $daysSelected variable comes from what has been selected. What I am trying to do is when a user selects an option, that option is now selected in the dropdown and the page returns, after the client hits submit.</p>
  
  <p>Does any one know what I am talking about?</p>
  
  <p>Thanks</p>