Re: I lied, another question / problem

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

 



Beauford wrote:
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

Then check it as an array.


$formerror = array();

... do your validation here which may/may not add to the array.

if (!empty($formerror)) {
  echo "Something went wrong!";
  print_r($formerror);
} else {
  echo "Everything is ok!";
}

--
Postgresql & php tutorials
http://www.designmagick.com/

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