prepare("SELECT id, mdp FROM admin WHERE pseudo = ?"); $req->execute(array($pseudo)); $user_exist = $req->rowcount(); if ($user_exist == 1) { while ($user_login = $req->fetch()) { $passwd = $user_login['mdp']; if ((password_verify($password, $passwd)) == 1) { $_SESSION['id'] = $user_login['id']; header('Refresh:0'); } else { $error = "Mot de passe invalide !"; } } } else { $error = "Identifiant invalide !"; } } else { $error = "Tout les champs doivent être complétés"; } } ?> Admin / index

Accès : "; switch ($user['perm']) { case 0: echo "GDA"; break; case 1: echo "Bureau"; break; case 2: echo "Admin"; break; } } else { ?>
".$error.""; } ?>