Jump to content

PHP altering navigation, more than one header.php file


ryan.coughlin

Recommended Posts

Hey guys,

 

i have been playing with my PHP navigation and trying to have more than one header.php file because of the site I am working on.

 

Here is my code:

 

<?php
if (isset($_GET['p'])) {
$pages = array('contact','drinksspecials','bulletin','pictures','media','designfriends','header','header-home');
if (in_array($_GET['p'], $pages)) { // if exists, then include it
$page=$_GET['p'] ;
}
else {
$page='404';
}
}

else { // default page
$page='default';
}

if ($page=='default') {
$header='header';
}
else {
$header='header-home';
}

include "$header.php";     
include "$page.php";
include "footer.php";

?> 

 

http://rksdesignstudios.com/clients/200orchard/index.php

 

When you click on any other site but the index.php page it doesnt work.  The default.php page loads, but the others dont render with the PHP.

 

Any suggestions?

 

Thanks,

 

Ryan Coughlin

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.