08-03-2011, 04:00 PM
|
#2 (permalink)
|
|
The Acquainted
Join Date: Nov 2009
Location: nr Stratford-Upon-Avon
Posts: 137
Thanks: 3
|
Try...
Code:
If ( empty(($up == 2) && ($app == 2) && ($dep == 2) && ($sold == 2)) ) {
$error=1;
$error_message="<p class=\"message invalid\"> Select At Least 1 Stage <span class=\"close\">X</span> </p>";
echo $error_message;
}
Just re-read what you posted and you want it to meet any of the requirements ?
you need to change the && to ||
One is and, the "||" means or ..
Also as I have done in my example, each part needs to be evaluated, so you need to have each test bracketed..
Code:
<?php
$up = 2;
$app = 2;
$dep = 2;
$sold = 2;
If ( ( ($up == 2) || ($app == 2) || ($dep == 2) || ($sold == 2) ) )
{
echo "OR is TRUE<br />";
} else{
echo "OR is False<br />";
}
If ( ( ($up == 2) && ($app == 2) && ($dep == 2) && ($sold == 2) ) )
{
echo "AND is TRUE<br />";
}else{
echo "And is FALSE<br />";
}
?>
__________________
Thanks... Simon
Sex, Drugs & Linux Rules
|
|
|