Jump to content

How to use OR in IF statement?


lopes_andre

Recommended Posts

Hi, I'am trying to write some code. I'am trying to do this, but the code is not working. How to use the OR in IF statement?

 

Sorry my english.

 

if ($_SERVER['PHP_SELF'] != "/alarmes.php" OR $_SERVER['PHP_SELF'] != "/register.php") {

echo "123";

} else {
echo "";
}

 

Best Regards, André

Link to comment
https://forums.phpfreaks.com/topic/147091-how-to-use-or-in-if-statement/
Share on other sites

what do u want to do ?

 

if page is not register.php and alarmes.php u want to allow ?

 

if ($_SERVER['PHP_SELF'] != "/alarmes.php" && $_SERVER['PHP_SELF'] != "/register.php") {
} else {
echo "";
}

 

OR generally got with == for != AND should be used. not necessary but thumb rule

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.