Jump to content

Recommended Posts

You won't want to store the actual password in a database, but rather a hash of it, using one of the many hashing algorithms available, preferably with a salt as well. The disadvantage is you can't retrieve the original value of a hash, you can only change it to a new hash if the user forgets their password. Still, it's the most common way of doing it.

 

You'll also want to be certain your code isn't vulnerable to SQL injection attacks, but that is true regardless of how you store the passwords. User-supplied data should never be placed directly into a db query. It should always be sanitized with mysql_real_escape_string/mysqli_real_escape_string, typecasting, etc. before being allowed anywhere near a query.

I see, ok I guess I'm going to have to look up how to hash them then.  Another thing to add to my list of things to do...  Alright, thanks for the help.  I didn't want to start my login script without knowing whether or not I could make it secure.

 

I'm pretty new to this whole PHP coding as I've mainly stuck with C++ so I'm not so sure as to how a lot of this web security and server security go.

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.