Hi,
I am having a problem with this if and or statement. It is a part of my form validation. But if give the same error regardless
The way I need it to work is like this:
$p, $d, $c and $o can all be Yes or No
If $p is Yes I then need to check if $d, $c or $o is Yes
If not it give an the error
This is the current code I have.
I have tried the same code without brackets before the or part, but it give the same problem
if ($p == "Yes" && ($d != "Yes" || $c != "Yes" || $o != "Yes")) {
echo "error";
}
Any help or fix would be great, I am sure it something silly, or maybe I got it the wrong way around or something silly like that.
Thanks