Prova cosi':
Codice PHP:
$sql="SELECT nickname,pwd,livello FROM utente
WHERE nickname='$user' and pwd ='$pass'";
$count=mysql_num_rows($ris);
if($count == 1){
$row=mysql_fetch_assoc($ris);
} else {
exit("login non corretto";)
}
if($row["livello"] == 'Esterno') {
$_SESSION["sess_var"] = "2";
header("location:menu_livello_2.php");
exit;
} elseif($row["livello"]=='Interno') {
$_SESSION["sess_var"] = "3";
header("location:menu_livello_3.php");
exit;
} elseif($row["livello"]=='Amministratore'){
$_SESSION["sess_var"] = "4";
header("location:menu_livello_4.php");
exit;
} else {
header("location:menu.html");
exit;
}