Web Development

Our forums are currently in maintenance mode and the ability to post is disabled. We will be back up and running as soon as possible. Thanks for your patience!

General discussion


PHP and MySQL password change form with MD5

By cphillips ·

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.

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!

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

I would

by Jaqui In reply to PHP and MySQL password ch ...

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.

Related Discussions

Related Forums