Ajouter un membre
password_hash($_POST['password'], PASSWORD_BCRYPT); try { //insert into database $stmt = $db->prepare('INSERT INTO blog_members (username,password,email) VALUES (:username, :password, :email)') ; $stmt->execute(array( ':username' => $username, ':password' => $hashedpassword, ':email' => $email )); //redirect to index page header('Location: users.php?action=ajoute'); exit; } catch(PDOException $e) { echo $e->getMessage(); } } } //check for any errors if(isset($error)){ foreach($error as $error){ echo ''.$error.'
'; } } ?>