Jump to content

Comparison issues. (IF Statement)


ChrisMartino

Recommended Posts

Hey there,

 

Now usually after a while I can always solve bugs with my code but this one really has me at a halt here.

 

So basically I have a function that returns true if the accounts username = demo and false if it doesn't but the following if statement returns true and executes the code every time regardless of the returned value of the function like so:

 

if(isset($_POST['server_start']) or isset($_POST['server_stop']) or isset($_POST['server_restart']) && $Class['Account']->is_demo_account($_SESSION['account_id']) == false)

 

 

Now if I run the following code right above that:

 

if($Class['Account']->is_demo_account($_SESSION['account_id']) == false) echo "it isn't a demo account.";
else echo "it is a demo account.";

 

It will echo "it is a demo account" correctly. Now can somebody please tell me why the if statement with the post values in always return true.

 

Thanks for your time!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.