Hello guys. I am working on a PHP page, where the content of the page changes depending on the option clicked in the navigation bar. I was following a tutorial on how to do this, but the tutorial didn't work to the effect I wanted.
Is it possible that someone here, who is more experienced at PHP than myself, could help me out? This is the code I have so far, but it doesn't seem to work. I would post the error message I get, but everytime I find where I've gone wrong and fix it, another (different) error message comes up.
<?php
$navbar = "| <a href=\"games.php?id=intro\" title=\"Page intro\">Intro</a> | <a href=\"games.php?id=bluetruck\" title=\"Blue Truck\">Blue Truck</a> | <a href=\"games.php?id=redhouse\" title=\"Red House\">Red House</a> | <a href=\"games.php?id=brownbear\" title=\"Brown Bear\">Brown Bear</a> |";
if ($_GET['id'], bluetruck) {
$content = "Blue Truck";
}
if ($_GET['id'], redhouse) {
$content = "Red House";
}
if ($_GET['id'], brownbear) {
$content = "Brown Bear";
}
elseif (!isset($_GET['id'])) {
$content = "Intro";
}
include "template.php";
?>
Any help would be much appreciated 😃