Reputation: 57
I currently have multiple pages for my website. I currently am using no header for each page because the links change on each page.
Example: if I am on the home page and click on a Testimonial tab, I don't want the Testimonial tab to still be there once I am redirected to that page, since I am already on that page!
How can I do create a single header file that gets modified on each page. Can this be done in php or javascript
Upvotes: 0
Views: 40
Reputation: 482
Use php using your current location as follows
<?php
$page=$_SERVER["REQUEST_URI"];
?>
<?php if (strcmp($page, "/testimonial") !== 0)
{
?>
<li class="testimonial"><a src="">link</a></li>
<?php
}
?>
Compare it to the page you want it to be, and decide if you want to display it or not
Upvotes: 1