I have a two page website -- a home page and an about page. I am trying to add a third page, but I am having a hard time figuring out the correct code.
I have this PHP at the top of my index.php page...
$tmp=str_replace("index.php","",$_SERVER['QUERY_STRING']);
$tmp=explode("/",$tmp);
$i=1;
$path=$_SERVER['REQUEST_URI'];
foreach($tmp as $str){
if($i==1){
$q=$str;
$path=str_replace('about/','',$path);
break;
}
$i++;
}
?>
And this in my nav area...
<ul class="nav navbar-nav"> <li<?php if(empty($q)){echo"
class=\"active\"";}?>><a href="/"><i class="fa fa-home fa-fw"></i>
Home</a></li>
</ul> <?php if(defined('emailReceiver')&&emailReceiver){?> <ul
class="nav navbar-nav navbar-right">
<li<?php if(!empty($q)&&$q=="about"){echo"
class=\"active\"";}?>><a href="<?php echo$path;?>about/"><i
class="fa fa-question-circle fa-fw"></i> About This
Site</a></li> </ul>
I think I need to create other instances of $i -- but I am not sure exactly what.