I have a page with let's say 3 links in the menu.
Home, About and Contact.
I want to convert my site into a single-page PHP-site. So for instance to see the about page the URL would look something like http://www.mydomain.com/index.php?nav=about
I was thinking of making the index.php like this:
<html>
<head>
...
</head>
<?php
$nav = $_GET['nav'];
switch ($nav) {
case "" && "index" && "main":
require("main.html");
break;
case "about":
require("about.html");
break;
case "contact":
require("contact.html");
break;
default:
require("main.html");
}
?>
</html>
Then main.html, about.html and contact.html would contain from <body> to </body>.
My problem is that I want to be able to see which page I'm currently displaying, in the menu by giving this particular link a class called "current" defined in my stylesheet.
How do I do this the easiest way, with the single-page website?
Thank you in advance