prepare("SELECT id FROM admin WHERE pseudo = ?"); $req->execute(array($pseudo)); $user_exist = $req->rowcount(); if ($user_exist == 1) { while ($user_login = $req->fetch()) { $_SESSION['id'] = $user_login['id']; header('Refresh:0'); } } else { $error = "Identifiant invalide !"; } } if(isset($_POST['login'])) { session_start(); $_SESSION = array(); session_destroy(); header('Refresh:0'); } ?>