ho questo codice:

codice:
$user = stripslashes(trim($_POST['user']));
$psw = stripslashes(trim($_POST['psw']));
	
$flag = (strlen($user) > 4 && strlen($psw) > 4) ? true : false;
	
//procedo a prelevare l'user dal database	
if ($flag){
  $sql = "SELECT * FROM user_access WHERE user LIKE '".$user."' AND psw LIKE '".md5($psw)."'";
  $res = mysql_query($sql)or die('...autentication: '.mysql_error());
  $row = mysql_fetch_assoc($res);
  if (mysql_num_rows($res) <> 0)
	$_SESSION['user'] = $row['user'];
}
ma ho verificato e non mi entra mai nel secondo if, questo perché $flag non assume mai true anche se i due campi di testo hanno una lunghezza maggiore di 4.
Ho pensato che magari fosse sbagliata la forma contratta dell'if, ma ho provato anche a scriverla nella forma estesa:

codice:
if (strlen($user) > 4 && strlen($psw) > 4)	$flag = true;
else $flag = false;
ma non cambia niente! Io non vedo nessun errore, voi?

Vi ringrazio!