<?php
if(!in_array($_GET['page'], array('index', 'products', 'contact', 'about'))) {
$page = 'index';
} else {
$page = $_GET['page'];
}
$driver = false;
switch($page)
{
case 'products';
//include 'classes/products.php';
echo "<h1>".$page."</h1>";
echo "<a href='?page=index'>Index</a><br />";
echo "<a href='?page=products'>Products</a><br />";
echo "<a href='?page=contact'>Contact</a><br />";
echo "<a href='?page=about'>About</a><br />";
//$driver = new ProductCategory($_GET['cat']);
break;
case 'contact';
//include 'classes/contact.php';
echo "<h1>".$page."</h1>";
echo "<a href='?page=index'>Index</a><br />";
echo "<a href='?page=products'>Products</a><br />";
echo "<a href='?page=contact'>Contact</a><br />";
echo "<a href='?page=about'>About</a><br />";
//$driver = new Contact();
break;
case 'about';
//include 'classes/about.php';
echo "<h1>".$page."</h1>";
echo "<a href='?page=index'>Index</a><br />";
echo "<a href='?page=products'>Products</a><br />";
echo "<a href='?page=contact'>Contact</a><br />";
echo "<a href='?page=about'>About</a><br />";
//$driver = new About();
break;
case 'index';
default:
//include 'classes/index.php';
echo "<h1>".$page."</h1>";
echo "<a href='?page=index'>Index</a><br />";
echo "<a href='?page=products'>Products</a><br />";
echo "<a href='?page=contact'>Contact</a><br />";
echo "<a href='?page=about'>About</a><br />";
//$driver = new Mainpage();
break;
}
if($driver){
$driver->display();
} else {
die('Pff');
}
?>