RE: [PHP] Validation function doesn't work (sort of...)

2003-05-27 Thread Jonathan Wilkes
Wilkes Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Validation function doesn't work (sort of...) $a === $b Identical*TRUE* if $a is equal to $b, and they are of the same type. (PHP 4 only) Jonathan Wilkes wrote: >That's not his problem, he is using "===" eua

Re: [PHP] Validation function doesn't work (sort of...)

2003-05-27 Thread Marek Kilimajer
item in the array. cheers, Jonathan -Original Message- From: Philip Olson [mailto:[EMAIL PROTECTED] Sent: 27 May 2003 17:03 To: Jason Lange Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Validation function doesn't work (sort of...) When you found success in the loop you really should

Re: [PHP] Validation function doesn't work (sort of...)

2003-05-27 Thread David Grant
Jonathan Wilkes wrote: That's not his problem, he is using "===" euality check which just checks the "type" of data, hence his code is returning TRUE for every item in the array. http://www.php.net/manual/en/language.operators.comparison.php Not so -- the identical ("===") comparison operator che

Re: [PHP] Validation function doesn't work (sort of...)

2003-05-27 Thread David Grant
Jason Lange wrote: for ($i = 0; $i < $vCount; ++$i) { if (($cryptUser === $validUser[$i]) && ($cryptPass === $validPass[$i])) { $retVal = true; + break; } else { $retVal = false; } } retu

RE: [PHP] Validation function doesn't work (sort of...)

2003-05-27 Thread Philip Olson
th type and value. I'm 98% sure I described the exact problem below. Regards, Philip > -Original Message- > From: Philip Olson [mailto:[EMAIL PROTECTED] > Sent: 27 May 2003 17:03 > To: Jason Lange > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Validation function doesn

RE: [PHP] Validation function doesn't work (sort of...)

2003-05-27 Thread Jonathan Wilkes
17:03 To: Jason Lange Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Validation function doesn't work (sort of...) When you found success in the loop you really should end the loop otherwise it will keep checking and will yield results as you describe. For example: while (1) { if (so

Re: [PHP] Validation function doesn't work (sort of...)

2003-05-27 Thread Philip Olson
When you found success in the loop you really should end the loop otherwise it will keep checking and will yield results as you describe. For example: while (1) { if (something) { $foo = true; break; } else { $foo = false; } } When $foo = true, the loop ends,

RE: [PHP] Validation function doesn't work (sort of...)

2003-05-27 Thread Jonathan Wilkes
Shouldn't your equality check be "==" instead of "===" ? Also, try modifying your loop so that after the first correct match, it does a return true; that way, you don't need to process the entire loop

[PHP] Validation function doesn't work (sort of...)

2003-05-27 Thread Jason Lange
Hello all, I've created this nice validation function which compares a submitted username and password to an array of acceptable values. However, at the moment it will only match the *last* key in the array. Even when I /*know*/ that I typed in the correct values (typed them in Notepad and cop