RE: I lied, another question / problem

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

 



 
> This is a bad way to test for a value also, unless you 
> expecting only TRUE or FALSE and you are sure that it will 
> always be set.

> Otherwise you should do something like this
> 
> if ( isset($formerror) && $formerror != '' ) {
>     // Display Error
> }

The problem here is this. formerror is an array and can have formerror['a'],
formerror['b'], etc. I don't care how many errors there are, I only want to
know if there was an error somewhere along the way.

Example:  if I have two fields, Name and Age and they both have errors, I
would echo $formerror['name'] and $formerror['age']

Then I check if(!$formerror) { do something...... This would not get done as
the above two have errors, which is what I want.

The problem still lies with something being returned from the function even
if there are no errors. So if(!$formerror) never gets done. Which is the
problem.

Another question, and not related, how do I kill a session when someone
leaves a particular page. 

Thanks

-- 
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