Jump to content

Recommended Posts

hi,

 

what I'm trying to do is allow a user to enter their username and password in either upper or lower case and have it match the data in the MySQL database either way. For example they may input everything in upper case or maybe just the password in upper and the username in a mixture or upper and lower. Is there any way that this can be broken down into a simple MySQL search which would return a match no matter what case the characters are in?

 

cheers!

Yes.... and no.

 

Yes, if you do where `field` = '$var'

 

you MUST match case

 

but if you do where `field` LIKE '$var'

 

you DON'T have to match case

 

BUT...

 

The password in another matter. I Assume you are encrypting passwords, either Sha1 or md5 or whatever.  For that to work, the password MUST BE EXACT... If you are not encrypting, you prolly have another problem:  If you enter % for the password, and are using LIKE you will allow anyone to log in.  If you are using = you have the same problem with case...

 

EDIT:  Or, convert everything to uppercase  :P

 

tbh mate i am not currently encrypting my data. How do you actually do this securely? is is a simple case of converting the usernames and passwords to md5 and then storing them in the database. when the user enters their password though and it is again encrypted before a match search is performed will this encrypted string not differ from what is stored in the database?

 

can you explain how i should go about encrypting my data?

 

thanks a lot!

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.