Hi,
i have a login page which is connected with a mysql database table called tbl_user.
Basically two fields :
user_name & pass_word.
Assume i have saved a user name called 'ABC' & my password is 'aBc123'.
When i log in to the system i enter my user name 'ABC' & type my password as 'aBc123'.
But the problem is i can log in to the system when i enter 'abc123'.But my real password is 'aBc123'.So my guess is that the password should be case sensitive.

Apache/2.2.17 (Fedora)
PHP Version 5.3.6
mysql 5.1.56

Can anyone please help me to figure this out?

Thanks in advance....

    You are probably using a case-insensitive collation in your database table (e.g. utf8-general-ci). My first suggestion would be to hash your passwords (such as with sha1) which will effectively make them case-sensitive and also increase your security. But if you don't want to do that for some reason, then you could use the strcmp() function in your MySQL query, adding the optional "collate" expression to specify that a case-sensitive collation be used. Or you could just change the database table definition to change the collation.

      Thanks NogDog for your quick reply.
      But can u be more specific?
      What is the best collation type to change the database field to a case sensitive one?
      please help me to figure this out..

      thanks in advance...

        ishakya wrote:

        What is the best collation type to change the database field to a case sensitive one?

        Whichever one you're using now should end in "_ci".

        Just use the collation with the same name without that "_ci" suffix.

          Thanks Brother.....
          Thanks a Lot......

            Write a Reply...