Help with Logical 'OR'
| From: | jv | Date: | Mon, 28 Jan 2002 20:04:31 +0000 |
| Subject: | Help with Logical 'OR' | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-82460@lists.php.net to get a copy of this message | ||
It seems that only the first condition is being evaluated.
I know that if both of the following conditions are false then the second
set of statements should get read, and that's what happens, but when I set
$name to true and $text to false (true||false) then the first set gets read.
Shouldn't both conditions be true in order for the first set of statements
be read? Why would the first set of statements get read when the conditions
are (true||false)?
Thanks in advance for your help.
james
********************************************************************
if ($name || $text)
{
$text = stripslashes("$text");
print "Hello $name\n<br>";
print "You said:\n<br> $text\n";
}else{
print "Sorry, but you seem to have left one or more entries blank.<br>\n";
print "Please return to <a href=\"/prac/form.html\">form</a>\n";
print " and complete the input<br>\n";
}
**********************************************************************