Salve,
Ho realizzato un form html del tipo
<FORM METHOD="GET" ACTION="user/list.php">
<SELECT NAME="Struttura[]">
<OPTION>tutte</OPTION>
<OPTION>agriturismo</OPTION>
<OPTION>appartamento</OPTION>
<OPTION>bed and breakfast</OPTION>
<OPTION>residence</OPTION>
<OPTION>tutte</OPTION>
</SELECT>
<SELECT NAME="Localita[]">
<OPTION>tutte</OPTION>
<OPTION>agriturismo</OPTION>
<OPTION>appartamento</OPTION>
<OPTION>bed and breakfast</OPTION>
<OPTION>residence</OPTION>
<OPTION>tutte</OPTION>
</SELECT>
Recupero l'array Struttura[] e quello Localita[] nel file list.php in questo modo:
foreach($_REQUEST["Struttura"] as $tipo){
}
foreach($_REQUEST["Localita"] as $localita){
}
e mi genero pagina e query sfruttando le variabili $tipo,$localita.
Quello che vorrei è un comportamento differenziato per la query nel caso in cui si selezioni
1)struttura == "tutte"
2)localita=="tutte"
3)struttura == "tutte" e localita=="tutte"
Seguendo alcuni suggerimenti avevo pensato di mettere un if nell'header del tipo
<?php
if ($tipo=="tutte") {
header ("Location:nuovapaginavedi_tutte.php");}
****************************************
***************
e fare in vedi_tutte.php la query senza senza la clausola where
poi un altro if ($localita=="tutte")
e un if ($localita=="tutte") && ($tipo=="tutte")
ma ho dei problemi.
Qualcosa non va bene nei vari if, come mi suggerite di ovviare a livello di salti condizionali ed ottenere i 3 comportamenti desiderati?
Fatemi sapere e grazie per l'aiuto