Jump to content

capitals


squiblo

Recommended Posts

I am making a register script and I am trying to give an error for passwords that are not recommended, such as "password" or the password being the same as the username. Something like this..

 

if ($newpass == "password")

 

But the problem with this is, the user might enter "paSSwOrd" and the condition will say they do not equal, so what can I do so the capitals the user inputs does not matter.

 

Sorry if you do not understand, I find it hard to explain.

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/207367-capitals/
Share on other sites

Although your question has been answered, here's a small tip:

 

To be more efficient, use single quotes in the password variable (e.g. strtolower($newpass) == 'password'). This will not make PHP search for special characters (such as \n) or variables in the string and thus use less memory.

Link to comment
https://forums.phpfreaks.com/topic/207367-capitals/#findComment-1084193
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.