<?php // Assign the requested page to a shorter variable for simplicity.// The value of $_GET["page"] will be obtained from index.php?page=RIGHT_HERE$p = $_GET["page"];// Check for bad requests. This is a security measure.if (strpos($p,"..")) { // A bad request has been made, exit immediately. Do not proceed with the inclusion. die("Bad page request");}// File to include. If $p is empty, fall back to // main.php. THIS FILE MUST EXIST.if (!$p) $p = "main";$content_file=$_SERVER["DOCUMENT_ROOT"]."/".$p.".php";// See if $content_file exists. If it does not, redirect to the homepage.if (!file_exists($content_file)) { //if I comment out this header line then the error goes away //but I see only the header and not anything else header("Location: {$_SERVER["PHP_SELF"]}"); exit();}?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Language" content="en-us" /> <link href="index.css" rel="stylesheet" type="text/css"> <title><?=$title ?></title> </head> <body> <div id="container"> <div id="header"><?php include("header.php"); ?></div> <div id="menu"><?php include("menu.php"); ?></div> <div id="content"><?php include($content_file); ?></div> <div id="footer"><?php include("footer.php"); ?></div> </div> </body></html>