Advertisement
Guest User

Untitled

a guest
Feb 16th, 2012
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement