never say "doesnt work", that tells us nothing. be specific.
what result were you expecting?
what result did you actually get?
anyway....
if your were expecting "cool" from the first code snippit, and you didnt get it, that means that BOTH $xxx1 and $xxx2 did not have the value of string 'error'
some tips for debugging
turn error_reporting all the way up.
error_reporting(E_ALL);
if something is not what you expect, check to see what it is
if(($xxx1 == "error") or ($xxx2 == "error")) {
echo"COOL";
}
else {
echo"OOPS";
}
echo '$xxx1 == ' .$xxx1;
echo '$xxx2 == ' .$xxx2;