|
|
#1 (permalink) | |
|
rocks your socks.
Resident.
Joined in Mar 2004
Lives in fear of Obama.
Hosted on Pass 7
13,170 posts
Gave thanks: 8
Thanked 35 times
|
Stupid Person Error Checking
Atleast, that's what I began calling it when it popped in my head the other day:
Quote:
|
|
|
|
|
|
|
#3 (permalink) |
|
rocks your socks.
Resident.
Joined in Mar 2004
Lives in fear of Obama.
Hosted on Pass 7
13,170 posts
Gave thanks: 8
Thanked 35 times
|
Ok. Now, why is that more efficient? An explination would help, as per usual with me. It just seems like running two functions verses one would not be better.
|
|
|
|
|
|
#4 (permalink) |
|
All Ur Base R Belong 2 Us
Excelling Contributor
Joined in Feb 2005
Lives in Vegas & New York
824 posts
Gave thanks: 2
Thanked 6 times
|
Regular expressions are more "expensive" on the CPU than regular string matching.
That's why they suggest using string matching instead of pattern matching for simple searches (i.e. a particular word is in a word/sentence)
__________________
Nobody doing nothing |
|
|
|
|
|
#5 (permalink) |
|
rocks your socks.
Resident.
Joined in Mar 2004
Lives in fear of Obama.
Hosted on Pass 7
13,170 posts
Gave thanks: 8
Thanked 35 times
|
Ok, and using the above method would work as a case-insensitive search? That's why I went with regex in the first place, was because I couldn't find another way to find case variations of the word.
|
|
|
|
|
|
#6 (permalink) |
|
rocks your socks.
Resident.
Joined in Mar 2004
Lives in fear of Obama.
Hosted on Pass 7
13,170 posts
Gave thanks: 8
Thanked 35 times
|
Ok, I think I understand now. strtolower will lowercase it all if the word is Password. But will it do it if it's PasSWorD? Of course, I guess I could just try it and find out.
edit: ok, I tried it and it didn't work at all any more. Every variation of the word password that I tried was submitted successfully. Last edited by David; March 1st, 2006 at 8:21 PM.. |
|
|
|
|
|
#7 (permalink) |
|
after g, before i
Resident.
Joined in Jul 2004
Lives in N,BC,CA
8,092 posts
Gave thanks: 48
Thanked 131 times
|
Ok, I know what it's not working. If you start password as the first character, it sets the value to 0, or false.
PHP Code:
|
|
|
|
|
|
#9 (permalink) |
|
after g, before i
Resident.
Joined in Jul 2004
Lives in N,BC,CA
8,092 posts
Gave thanks: 48
Thanked 131 times
|
Ack.. What was I thinking?
PHP Code:
|
|
|
|