Jump to content

User Authentication


coop

Recommended Posts

User Authentication

Hi all,

Still new to php so I'll try and explain my problem.
I'm trying to produce a User authentication page so a user can log in with a user name and password. I've worked out setting up the database and adding new users to the database. So now people can log into pages using there user_id and password which is checked on the MySQL database.
The problem comes when a user forgets there password and I wanted to send it to the email that they used in the registration. I'm using md5(), so the database contains a 32-character hash, it is possible to transfer this back to plain text.   

Any help would be greatly apperciated. I'm usin fFlash for the front end but any help or tutorials would be fine.

c.
Link to comment
Share on other sites

You can't reverse the md5() information.  So, I think a good solution in your case is to frist validate which user forgot their password and then send them to a 'change password' page.  Since you already have their email address, you can simply send them an email with a link to the change password page.  The link can contain some encoded information about the user so you can verify it's them returning.  Then, they change their password and move on.
Link to comment
Share on other sites

From my experience, md5 password's can't be sent as plain text.

The best thing to do is to reset the password.
If they forget the password, email them a link, once they click on the link, it will direct them to a page where they can re-enter a new password, and that will update the database with the new password.

That's the only way that I know how to do it.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.