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.
Written by Zach Queal
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#