PX : code

String Query Navigation by sardonyx quinx
Download this code


<?php
//String Query Navigation, categorized in PHP Navigation section.
// by admin[at]sardesigns[dot]tk at http://www.sardesigns.tk
// Free-license granted to any user who will use this source code.
// Just don't forget to link back SARDesigns and retain this credit notice.
//  2003 SARDesigns. all rights reserved. 

// use the switch or case function as the backbone of this script.
// php variable, get method is also used as the initial string to be
// compared with the second string. 

switch ($_GET['what']) {

// if stringquery.php?what=about then go to about.php
case "about":
$inc 'about.php';
break; 

// if stringquery.php?what=links then go to resources.php
case "links":
$inc 'resources.php';
break; 

// if stringquery.php?what=nothing then go to 404.php
default:
$inc '404.php';
break; 

// check whether the file exist or not.
if (file_exists("$inc")) {
include_once(
"$inc");
}
else { 

// if the file doesn't exist, error message will be displayed.
include_once("404root.php");
}
?>

Comments or questions?
PX is running PHP 5.2.17
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.