tonyscarpelli Posted October 10, 2012 Share Posted October 10, 2012 If I entered the same new password as the old password, an error occurred that didn't inform the user of this. The following code can be changed as needed. CU I added the following code that checks for duplicate old and new passwords: //------------------------------------------------------------------------- // Check to see if password the same $q = "SELECT user_id FROM users WHERE (email='$e' AND pass=SHA1('$np') )"; $r = @mysqli_query($dbc, $q); $num = @mysqli_num_rows($r); if ($num == 1) { //echo 'Not OK' . ' ' . $num; // for testing. $errors[] = 'Your new password is the same as your old password.'; } //------------------------------------------------------------------------- if (empty($errors)) { // If everything's OK. Link to comment Share on other sites More sharing options...
Larry Posted October 10, 2012 Share Posted October 10, 2012 Thanks for sharing that! Link to comment Share on other sites More sharing options...
Recommended Posts