setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); if (isset($_POST['user'])) { $stmt = $conn->prepare("SELECT * FROM utenti WHERE username=? and password=? and admin=true"); $stmt->execute(array($_POST['user'],sha1($_POST['passwd']))); if ($stmt->fetch()) { $_SESSION['admin']=true; redirect_browser("elenco3.php"); } else echo "Utente non riconosciuto"; } else { ?> Login
Inserire username:
Inserire passwd: