prepare("SELECT * FROM users WHERE pseudo=?"); $req->execute(array($_POST['pseudo'])); if($req->fetch()){ header('Location:register.php?i=5'); }else{ $req = $GLOBALS['bdd']->prepare('INSERT INTO users(pseudo,mdp,date_creation) VALUES (?,?,NOW())'); $req->execute(array($_POST['pseudo'],$_POST['mdp'])); $_SESSION['session_id'] = $reponce['ID']; $_SESSION['session_mdp'] = $reponce['mdp']; header('Location:register.php?i=6'); } }else{ header('Location:register.php?i=4'); } }else{ header('Location:register.php?i=3'); } }else{ header('Location:register.php?i=2'); } }else{ header('Location:register.php?i=1'); } ?>