chicobandito Posted November 7, 2011 Share Posted November 7, 2011 Looking to set current page to more than one option... Something that sets $currentPage to contact.php or thankyou.php... how can I modify this statement below? <li><a href="contact.php" <?php if ($currentPage == 'contact.php') {echo 'id="here"';} ?>>Contact</a></li> Thanks for your time! Quote Link to comment https://forums.phpfreaks.com/topic/250593-how-can-i-add-an-or-to-this-line-of-code-currentpage-contactphp/ Share on other sites More sharing options...
chicobandito Posted November 7, 2011 Author Share Posted November 7, 2011 I think i found the answer, is this correct? I am using the operator "||" between the page options... ($currentPage == 'contact.php' || $currentPage == 'index.php') Quote Link to comment https://forums.phpfreaks.com/topic/250593-how-can-i-add-an-or-to-this-line-of-code-currentpage-contactphp/#findComment-1285745 Share on other sites More sharing options...
KevinM1 Posted November 7, 2011 Share Posted November 7, 2011 Yes, || is the logical 'or' operator. Quote Link to comment https://forums.phpfreaks.com/topic/250593-how-can-i-add-an-or-to-this-line-of-code-currentpage-contactphp/#findComment-1285748 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.