Hello everyone
I have created a simple website in PHP. I am using include functions for topnav,header,menu,sidebar and footer.
Now, i am having couple of issues in that:
1. Whenver I click on any menu item the title of my page is all the same on all pages.
2. I wanted to change the background color of the selected menu item (I am able to do it using CSS but if not using include funtions).
The code is like:
TOP nav.php
<br />
<pre lang="xml"><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><br />
<html><br />
<head><br />
<meta http-equiv="Content-type" content="text/html;charset=UTF-8"><br />
<title>My title goes here!</title><br />
<br />
<link rel="stylesheet" type="text/css" href="style/style.css"><br />
<br />
</head><br />
<body><br />
<div id="wrapper"><br />
<div id="topbar"><br />
<div class="date"><?php echo date("l jS \of F Y ");?></div><br />
<ul class="topnav"><br />
<br />
<li><a href="#">About us</a></li><br />
<li><a href="contact.php">Contact us</a></li><br />
</ul><br />
<br />
</div></pre><br />
Since all my html part like title description etc are saved in topnav.php, i am not able to change the title on index.php and so on.
Please guide like on which file i need to write the code like
<br />
<pre lang="php"><?php<br />
$title="";<br />
switch ($title){<br />
case "index.php":<br />
$title= "index title here";<br />
<br />
break;<br />
<br />
case "about.php":<br />
$title= "about title here";<br />
<br />
break;<br />
}<br />
<br />
?></pre><br />
<br />