user password not updating!


<?php // configuration require("../includes/config.php"); // if form was submitted if ($_SERVER["REQUEST_METHOD"] == "POST") { if(empty($_POST["password"])) { apologize("You must provide your password."); } else if(empty($_POST["newpassword"])) { apologize("You must provide a new password."); } else if ($_POST["password"] = $_POST["newpassword"]) { apologize("Your password and newpassword are the same, pls enter a different password"); } else // create newpassword { $rows = query("UPDATE users SET password = crypt('$_POST[newpassword]') WHERE username = '$_POST[username]'"); //redirect to portfolio redirect("/"); } } else { // else render form render("changePassword_form.php", ["title" => "changePassword"]); } ?>

the codes above is met for user who is currently login to be able to change his password but it happened not to update when the user tries to do so. Don’t know where i have gone wrong, pls help.


What happens? Is query() a proper function? Does it report errors?

thanks for your response, i have fixed it

Sponsor our Newsletter | Privacy Policy | Terms of Service