As the title reads, I am basically trying to create some sort of navigation system using php variables.
First of all i have created a template file which acts as the empty page to have new content filled into it. It is a pretty standard html page really and I've created images to be used as links. In an area below is space for content to be added.
currently in this area I am using the following code to insert the new content;
template.php
<?php include $content; ?>
My index page contains this code;
index.php
<?php
$content = 'main.php';
$pageTitle = 'Home';
require_once 'include/template.php';
?>
and so using this I have a working index page.
On to the problem:
My template file contains the images in a sort of navigation bar. I am wondering what is required to allow $content to be changed on the click of one of these images.
Currently i have tried using
<a href="index.php?content=newpage.php">
where "newpage.php" is already created and sat on the server.
However using this appears to have no effect as clicking the link seems to just refresh the page while changing the url in the address bar to what i would expect.
Any advice would be greatly appreciated and thanks for taking the time to read this 🙂