I am trying to create a "flash" success message which pops up when the user successfully changes their password. But, It doesn't work how I would like it to.
The basic idea is, when people enter their new password (and it passes to the database), it will echo to the page "Successfully updated password". But it will only echo once (when the user refreshes, the echoed message will disappear and not display again until they submit a new password).
I have tried searching around, but I can't seem to find any scripts that will actually work how I would like them to.
This is my PHP function, currently:
function updatePassword($conn, $newpwd, $username){
$newpwd = hash('md5', $newpwd);
mysqli_query($conn, "UPDATE users SET password = '$newpwd' WHERE username = '$username'");
}
Cheers.