Jump to content

Help with user authentication


carlg

Recommended Posts

When I enter a new user into my database table that stores users, I put the password in the database kind of like this.

 

crypt($pwd)

 

When I try to verify the user, I do something like this

 

if (crypt($pwd_user_just_entered) == $pwd_from_database)
{
//user logged in OK
}
else 
{
//invalid login
}

 

I think I'm doing something wrong

 

Any help is appreciated

 

Thanks

 

Link to comment
https://forums.phpfreaks.com/topic/70544-help-with-user-authentication/
Share on other sites

Hi,

 

The manual page for crypt (http://www.php.net/manual/en/function.crypt.php) raises a few issues to be wary of with this function. I haven't used it myself - I favour the md5 function myself, which seems to work fine.

 

Cheers,

Darren.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.