Case sensitive in php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • waqasahmed996
    New Member
    • Jun 2008
    • 160

    Case sensitive in php

    hello

    i have a login form.if user has password for example 'abc' then he will logon if he will give password abc or he will give password ABC

    i want that he can only be login if he will give password abc.

    means in which case password is in database user has to give password in same case
  • waqasahmed996
    New Member
    • Jun 2008
    • 160

    #2
    i found solution

    actually it is more related MYSQL than PHP

    field can be make case sensitive my changing fileld collation as latin1_general_ cs

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      Hi.

      As a basic security measure, you should always "hash" passwords before storing them inside your database. (Which would also solve your case-sensitive problem)

      That is, rather than store the plain-text password the user gives you, run it through the sha1 function before storing it. (Or the hash function, if you need a stronger algorithm.)
      That way the password will be safe even if somebody managed to break into your database.

      To validate the password when the user wants to log in, you simply hash the password you want to check and compare the hashes.

      Comment

      Working...