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"; } ?> Link to comment https://forums.phpfreaks.com/topic/105489-easy-script-question/ Share on other sites More sharing options...
runnerjp Posted May 13, 2008 Share Posted May 13, 2008 md5 ( $_POST['newpassword'] ) Link to comment https://forums.phpfreaks.com/topic/105489-easy-script-question/#findComment-540331 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!! Link to comment https://forums.phpfreaks.com/topic/105489-easy-script-question/#findComment-540457 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.