Clinton Posted May 13, 2008 Share Posted May 13, 2008 How do I format this if my passwords in the database are md8'd? <?php session_start(); include 'db.php'; $username = $_POST['username']; $password = $_POST['password']; $newpassword = $_POST['newpassword']; $confirmnewpassword = $_POST['confirmnewpassword']; $result = mysql_query("SELECT password FROM users WHERE username='$username'"); if(!$result) { echo "The username you entered does not exist"; } else if($password!= mysql_result($result, 0)) { echo "You entered an incorrect password"; } if($newpassword=$confirmnewpassword) $sql=mysql_query("UPDATE users SET password='$newpassword' where username='$username'"); if($sql) { echo "Congratulations You have successfully changed your password"; } else { echo "The new password and confirm new password fields must be the same"; } ?> Quote Link to comment Share on other sites More sharing options...
runnerjp Posted May 13, 2008 Share Posted May 13, 2008 md5 ( $_POST['newpassword'] ) Quote Link to comment Share on other sites More sharing options...
Fadion Posted May 13, 2008 Share Posted May 13, 2008 How do I format this if my passwords in the database are md8'd? Thought it was md5!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.