Jump to content

[SOLVED] CaseSensitive MySQL


otuatail

Recommended Posts

Having a problem with Username and Password. If I have an entry with

User = "ABCDE" and pwd = "VWXYZ"

 

and I enter "abcde" and "vwxyz" on an entry form. The following query will always work.

 

$sql = "SELECT UserID FROM Users WHERE user = '" . $User . "' AND pwd = '" . $PWD . "'";

 

This still works. I want it to fail over case sensitivity.

 

Desmond.

Link to comment
Share on other sites

Take a look at the md5() function. The idea is that whever you go to do something with a password, you apply the md5() function to it, to hash the string. So, when someone registers, the password you store is the hashed version. When someone logs in, you hash the password they provide, and check this against the password stored in the database.

Link to comment
Share on other sites

Ok the pest way to store the Password is MD5 and then do an MD5 check. The example here is

if (md5($str) === '1f3870be274f6c49b3e31a0c6728957f')

 

This is a 32 bit string will it always be 32 bit as some kind of CRC value. If so I can modify the database to

pwd` varchar(32) default NULL,

 

desmond.

 

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.