Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. $newPass = hash('sha256', $_POST['firstpassword'], false );
  2. echo($newPass);
  3.  
  4. $db = new database();
  5. $pdo = $db->connexion();
  6. $pseudo = $_SESSION['pseudo'];
  7.  
  8. $sql="UPDATE table SET Password=:pass WHERE Username=:name";
  9. $stmt = $pdo->prepare($sql);
  10.  
  11. $stmt->bindParam(':pass', $newPass, PDO::PARAM_STR);
  12. $stmt->bindParam(':name', $pseudo, PDO::PARAM_STR);
  13. $stmt->execute();
  14.  
  15. echo("<font color=green><h2>Votre mot de passe a bien été modifé</h2></font>");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement