Last Updated: February 25, 2016
·
907
· xanza

PHP Site Navigation

Idiot proof site navigation based on the PHP case function:

<?php
//usage: nava.php?page={case}

switch($_GET['page']){
default: //the default page case    
include('index.php');
break;

case 'about':
include('pages/about.php'); //relative to the file
break;

case 'downloads':
include('/var/www/othersite.com/pages/download.php'); //absolute files are acceptable
break;
}
?>

Simply upload this PHP file to your web root, and once your cases are configured you have a pretty simple 'pretty url' script.

http://example.com/navagation.php?page=downloads