Question:
How to make passwords case-sensitive in PHP/MySQL?
anonymous
2007-12-21 09:40:52 UTC
I have a register script that adds the password to the database and as I've noticed, it doesn't matter if the password is PASSWORD or PaSsWoRd or password, they all work when logging in at the login page.

I want the password to be case-sensitive, so if the user set "Password", either "PASSWORD" or "PassWorD" should work. ONLY "Password" when they're logging in.

It's PHP and MySQL that I'm coding with.
Three answers:
CC
2007-12-21 10:21:05 UTC
You can use the function strcmp($string1, $string2).
mosby
2016-11-24 00:48:52 UTC
in case you prefer a extra shield equipment then definite cause them to the two case mushy. It ability there are extra diversifications earlier people can ruin in. That stated, it fairly is the norm that usernames at the instant are not case mushy. working example, lively itemizing, it fairly is used to administration person money owed in abode windows networks is case-insenstive for person names. it fairly is made up by ability of forcing extra stringent password standards. Like - a minimum of one bigger case letter - a minimum of one image or numeric - a minimum of 8 characters in length So, considering the fact that maximum systems do no longer tension case sensitivity on usernames it fairly is extra effectual in the adventure that your internet site does. i comprehend once I run into ones that do, fairly while they tension you to have an bigger case letter on your person call, I continuously forget the foremost factors.
Positive P
2007-12-21 09:43:33 UTC
Sorry, I dont know.

All the best.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...