Re: One last try at this!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 17 Jan 2007, at 17:38, Beauford wrote:

if(empty($orgname)) { $formerror['orgname'] = "Optional"; }
elseif($result = ValidateString($orgname, "2")) { $formerror ['orgname'] =
$result; }
	
if(empty($website)) { $formerror['website'] = "Optional"; }
if($result = ValidateString($website, "2")) { $formerror['website'] =
$result; }

if(empty($event)) { $formerror['event'] = "Optional"; }
if($result = ValidateString($event, "2")) { $formerror['event'] = $result; }

Look at your conditional. To my (new to PHP) eyes, you're setting $result to whatever ValidateString($website, "2") returns. It should be:

$result == ValidateString($website, "2")

Some people countenance conditionals in the form:

ValidateString($event, "2") == $result

As this usually throws a fairly obvious error if you miss out the extra equals sign. Personally, I don't like this but I can see it helps one write more robust code the first time round.

HTH

Simon

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux