// check if the request is for a certain section if(!isset($_REQUEST['section'])){ //check to see if a variable called section was in the request, if not set it to index $section = 'index'; }else{ $section = $_REQUEST['section']; } //the request does include a certain section, this directs the browser there $section_file = "includes/$section.inc"; $site_array = array('Home' => 'index', 'Wireless Information' => 'info', 'Contact' => 'contact'); $error = false; // Check to see if the section exists if(file_exists($section_file)){ //it does exist, time to display it include($section_file); }else{ $error = true; $error_msg = "The section you requested is currently unavailable, if this problem continues please contact the webmaster"; //the file isn't there so display an error message } if($error){ //something went wrong so they get redirected to the error message include('includes/oops.inc'); } ?>
// Print the navigation links on the side
foreach($site_array as $link=>$sec){
if($section == $sec){
print '' . $link . '';
}else{
print '' . $link .'';
}
print ' '; } ?> |
// checks for an error
if($error){
// displays an error message
print ' An Error Occured |
|