I have this code in header.php:
<?php
$page = "";
?>
<ul class="nav navbar-nav navbar-right nav-pos">
<li <?php if ($page == "home") { ?> class="active"<?php } ?>><a href="home.php">Home</a></li>
<li <?php if($page == 'about') { ?> class="active"<?php } ?>><a href="aboutus.php">About us</a></li>
<li <?php if($page == 'contact'){ ?> class="active"<?php } ?>><a href="contactus.php">Contact us</a></li>
<li class="hidden-xs"><a href="#search"><i class="fa fa-search fa-rotate-90"></i></a></li>
</ul>
and on every page i put this code(and the name change depends on current page):
<?php include 'header.php';
$page = 'about' ?>
and in css i made this:
.active{color:red }
But it is not working... any idea why?
Thank you for time, I really appreciate it