Re: One last try at this!
| From: | Jim Lucas | Date: | Wed, 17 Jan 2007 21:36:10 +0000 |
| Subject: | Re: One last try at this! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-247264@lists.php.net to get a copy of this message | ||
Jay Blanchard wrote:
[snip]At least that is what I thought he said.The second condition of each if statement does not contain equality checking, it sets the $result to ValidateString($event, "2"). That should be if($result == ValidateString($event, "2")) or if($result === ValidateString($event, "2"))What if the intension was to fail if the result of ValidateString() was false?? Then it should be writen as such. if ( ( $result = ValidateString($event, "2") ) !== FALSE ) {$formerror['event'] = $result;} [/snip] Hmmm.....did you test that? $result = ValidateString($event, "2") is always TRUE, $result has had something assigned to it unless the function ValidateString returns a FALSE. The OP never provided the code for the function so we just don't know. Also, the OP forgot to run subsequent conditions in an elseif check, instead he used 3 if statements that will be executed each time. At one point he mentioned changing ValidateString() to return false on an error.