title: HTML select option set selected default echo get value php
body: <p>I have a simple HTML form with a simple select like this</p>
  
  <pre><code>&lt;select name="myselect"  selected="&lt;?php echo $_GET['brand'];?&gt;"&gt;
  
  &lt;option value="" &lt;?php if($brand== "") echo "selected"; ?&gt;&gt;all brands&lt;/option&gt;
  &lt;option value="samsung" &lt;?php if($brand== "samsung") echo "selected"; ?&gt;&gt;Samsung&lt;/option&gt;
  &lt;option value="motorola" &lt;?php if($brand== "motorola") echo "selected"; ?&gt;&gt;Motorola&lt;/option&gt;
  
  &lt;/select&gt;
  </code></pre>
  
  <p>What I am trying to do is because its a search filtering results form if the user choose Samsung as default brand to search next page with filteres search results will the select option default selected Samsung and no other. If user select to search Motorola then the selected option default will be Motorola.</p>
  
  <p>How do I fix this?</p>