Guest User

Untitled

a guest
Feb 16th, 2012
118
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <select name="categoria">
  2. <?php
  3. if(isset($_GET['categoria']) && !empty($_GET['categoria'])) {
  4. $imoveis = mysql_query("SELECT * FROM imoveis GROUP BY imovelTipo");
  5. while($res_seleciona = mysql_fetch_array$imoveis)){
  6.        $tipo = $res_seleciona['imovelTipo'];
  7.        $selected = ($_GET['categoria']) == $tipo ) ? ' selected="selected"' : '';
  8.     echo '<option '. $selected.' value="'.$tipo.'">&nbsp;'.$tipo.'</option>';
  9. }
  10. }
  11.  
  12. ?>
  13.  
  14. </select>
RAW Paste Data