title: Using PHP $_POST to remember a option in a select box?
body: <p>I have a form which POSTs to itselft so the user can do things that you would find in a Shopping Cart.</p>
  
  <p>e.g. Increase quantity, select postage type.</p>
  
  <p>My problem is for my form Select element called "postage" whenever the form reloads itself , it forgets what was selected. </p>
  
  <p>All my other fields remember their values using this:</p>
  
  <pre><code>&lt;input type="text" name="postcode" value="&lt;?php echo $_POST['postcode']; ?&gt; " /&gt;
  </code></pre>
  
  <p>How do I use the $_POST value to automatically select the option in the select field that was done by the user?</p>
  
  <p>I tried this:</p>
  
  <pre><code>&lt;select name="postage" selected="&lt;?php echo $_POST['postage']; ?&gt;" &gt;
  </code></pre>
  
  <p>and this</p>
  
  <pre><code>&lt;select name="postage" value="&lt;?php echo $_POST['postage']; ?&gt;" &gt;
  </code></pre>
  
  <p>Thanks</p>