Codice PHP:
//Verifica i dati della form
if (trim($_POST['cat'])=="") {
$cat = trim($_GET['cat']);
} else {
$cat = trim($_POST['cat']);
}
if (trim($_POST['loc'])=="") {
$loc = trim($_GET['loc']);
} else {
$loc = trim($_POST['loc']);
}
if ($cat=="" and $loc=="") {
$where = "Categoria = 'xcdfre32wqa' AND Localita = 'xcdfre32wqa'";
} elseif ($cat!="" and $loc!="") {
$where = "Categoria = '$cat' AND Localita = '$loc'";
} elseif ($cat!="" and $loc=="") {
$where = "Categoria = '$cat'";
} elseif ($cat=="" and $loc!="") {
$where = "Localita = '$loc'";
}
$loc = str_replace("&", "&", $loc);
//Conta i link
$query = "SELECT * FROM video WHERE $where";
$result = mysql_query($query, $db);
} elseif ($cat!="" and $loc=="") {
$where = "Categoria = '$cat'";
} elseif ($cat=="" and $loc!="") {
$where = "Localita = '$loc'";
}
Perchè con gli elseif evidenziati non mi dà risultati anche se ci sono?