Jump to content

Parse error: syntax error, unexpected T_LOGICAL_OR in


godrob

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.

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.