I am currently developing a website in purpose of learning some more, but I just could not figure this one out and I do not know what to search for exactly, I haven't found anything.
So basically I have a navigation bar, a content box, and a footer. I'd like to divide the website in to three files. That way, I would for example only need to edit one file to edit all links in the navigation bar on ALL pages.
I can simply do this by putting:
<?php include('navigation.php'); ?>
Where I want it to be. But here comes my problem: on each page that I have, my navigation bar should change its active page/tab and highlight it.
My navigation bar looks like this:
Home | News | About | Contact
When I click News
and land on the news page, it should get highlighted in the navigation bar (through CSS). But how can I achieve this when I have the navigation bar in one single file? Then it would highlight it on ALL pages. This is the problem I currently have and I have no clue if this is even possible in PHP?
Any help is appreciated! Thanks