Discussion Locked

PHP and MySQL password change form with MD5

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

Summary:
I am a beginner to PHP and MySQL. I have recently built my first user authentication web interface using PHP sessions, MySQL, and MD5. I can get the users to register, and then log in with a randomly generated password.

Problem:
My problem is no matter how hard I try I cannot get the change password form to work. I can get the variable to store the hash, but it wont "update" the MySQL database with the new hash.

Begging for help:
Could someone help me out and explain how to accomlish this? Ultimately I would like to be able (as the admin) to change a password to a temporary password for the user, and then the user can log on with the temporary password and change the temporary password to a new password.

Thank you for your time!

1 reply

by jaqui

use the password field ability in mysql.
pass and update text, into a table field designated as type password, mysql with encrypt it automatically.

the problem with using your own has, is that it doesn't always match the hashed password in the db, so it will get rejected.

mysql works by comparing a hashed entry to the has in the database for password fields, so if there is any discrepancy, then it will deny the alteration.

This discussion is closed to new replies.