PHP Case-Write verification

Source: Internet
Author: User
I have a login registration function, when I registered success AA this user, with AA username and AA password input, incredibly also successfully entered, I estimate is the size of the problem, look pointing

Reply content:

I have a login registration function, when I registered success AA this user, with AA username and AA password input, incredibly also successfully entered, I estimate is the size of the problem, look pointing

What is your database character set? You can choose to take a look with bin.

It is best to unify uppercase or lowercase, the database has no special settings and is case insensitive

The user name is usually converted to lowercase and stored, the user name should not be case-sensitive,
Your situation should be to take a username and password to the database to check. Returning a record is considered successful.
It is more reasonable to use only the user name to check, return the results, use if for password comparison

Most databases are case-insensitive by default, and if you want to differentiate, you have to get rid of the default settings for the database.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.