Jump to content

Parse error: syntax error, unexpected T_LOGICAL_OR in


Recommended Posts

Hi Guys,

 

I'm learning PHP and could do with some help with combining two conditions please.

 

<?php if(!is_page( array( 100, 1773, 1791, 1778, 1784 ) ) )  OR (!current_user_can("access_s2member_level0")) {
         
         echo 'CONTENT TO SHOW';
        
        }
?>

When I try to access the page I get:

 

Parse error: syntax error, unexpected T_LOGICAL_OR in .....

 

Any help appreciated

 

Thanks

Rob

Thanks for your reply.  Okay so if I modify my code to this:

 

                   

<?php if(current_user_can("access_s2member_level1") OR (!is_page( array( 100, 1773, 1791, 1778, 1784 ) ) ) ) {
                
                     echo '<link type="text/css" rel="stylesheet" id="arrowchat_css" media="all" href="/arrowchat/external.php?type=css" charset="utf-8" />';
	     echo '<script type="text/javascript" src="/arrowchat/includes/js/jquery.js"></script>';
        	     echo '<script type="text/javascript" src="/arrowchat/includes/js/jquery-ui.js"></script>';
        	   
                     }
                ?>

 

The Javascript still shows when it shouldn't.  However, if I isolate the code to just one query  ie, use just

current_user_can

or

!is_page

, they work fine independently.

 

What am I doing wrong?

 

Thanks

Rob.

 

Without knowing what those two functions are, what data is being passed to them, what the expected results versus the results you're getting are, and what the actual code is, there's no way to know for sure.

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.