Include this bit of php at the top of your document, BEFORE the <HTML> and <HEAD> tags:

<!--// START... Copy-->

<?php

// Enable output buffering
// More info: http://www.php.net/ob_start
ob_start();

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<!--// END... Copy-->


<html>

 <head>

 <body>

<td>   <--// You can use this anywhere. I choose to use it within table cells (<td>), as tables are how I build pages, but am currently refining css & <div>'s.-->


<!--// START... Copy and Paste From the next line ( you do not need to include this one )-->

<?php

// Define our array of allowed $_GET values - For every spec sheet you creat, You need to add it's name here. - Landis.
$pass = array( 'contact','service', 'about', 'parts', 'catalog', 'new', 'pmservice',
'028','053','245','045','046','042','043','040','052','039','245','248','035','034','014','038','057','056','054','058',  //(these are the names of html docs allowed)
);

// If the page is allowed, include it:
if (in_array($_GET['id'], $pass)) {
include ($_SERVER['DOCUMENT_ROOT'] . '/inc/' . $_GET['id'] . '.html');   //(this is where we diclair the extention for the allowed docs in the inc dir)
}

// If there is no $_GET['id'] defined, then serve the homepage:
elseif (!isset($_GET['id'])) {
include ($_SERVER['DOCUMENT_ROOT'] . '/inc/about.html');  //(this is where we diclair what doc will load by default when an id is not found or used)
}

?>

<!--// END... Copy to the line above ( you do not need to include this one either )-->

</td>

 </html>


See this in action:Response Forklift.com

Close this window