+ 5
how to change a password columm in my database
Hey guys I'm trying to make a change password script for my website. How do I go about it
7 Answers
+ 5
<?php
if (isset($_POST['submit'])) {
include_once 'dbh.inc.php';
$hashedPwd = password_hash($newpwd, PASSWORD_DEFAULT);
$sql = "UPDATE users SET user_pwd = $hashedPwd WHERE user_id = $_POST['email']";
}
if (mysqli_query($conn, $sql)) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . mysqli_error($conn);
}
mysqli_close($conn);
?>
note that $newpwd is the new password the person has just typed in the html form
+ 5
Here is the code @ bogdan
+ 2
can you show us your code?
+ 2
Thanks
+ 1
your code is not orking
0
because its an example. i didnt test it yet...