ryan.coughlin Posted March 30, 2007 Share Posted March 30, 2007 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 Link to comment https://forums.phpfreaks.com/topic/44861-php-altering-navigation-more-than-one-headerphp-file/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.