I am making my nav links highlighted when the page is where the link points to. However, because some of my links are simply index.php with GET variables, I am having trouble differentiating that with just index.php.
E.g. index.php and index.php?get=** with $_SERVER['PHP_SELF'] are both /index.php. how do I ensure that the page is at index.php without any get variables?
This is my nav highlighting code.
<?php
if( $_SERVER['PHP_SELF'] == '/index.php'
&&
! isset($_GET)
)
{ echo 'class="white"'; }
You can check if $_GET is empty like this: