Setting a default page for a dynamic changing content website

ritz

New Member
Forgive me as I am still kinda new at web development. :)Normally when I create my websites I create a file called header.html and footer.html and just include this files into my webpages to be consistent also so that I only change data once then add whatever code is necessary. (Eg: index.php)\[code\]<?phpinclude ('includes/header.html');include ('html/index.html');include ('includes/footer.html');//other php codes?>\[/code\]Now my problem is that on one of my pages (food-menu.php), I have a sidebar that has got links that I have setup to retrieve the pages according to the links that are clicked - and the code that I am currently works in terms of retrieving dynamic content. My only problem is how can i setup a default content include on that page before it goes dynamic?The sidebar goes like this:\[code\]//Sidebar <section class="widget"> <h3 class="title">Main Menu</h3> <ul> <li><a href="http://stackoverflow.com/questions/15859413/?link=1" name="link1" title="View all Cold Starters">Cold Starters</a></li> <li><a href="http://stackoverflow.com/questions/15859413/?link=2" name="link2" title="View all Hot Starters">Hot Starters</a></li> <li><a href="http://stackoverflow.com/questions/15859413/?link=3" name="link3" title="View all Charcoal Grilled">Charcoal Grilled</a></li> <li><a href="http://stackoverflow.com/questions/15859413/?link=4" name="link4" title="View all Chef's Special">Chef's Special</a></li> </ul></section>\[/code\]then the main file is (food-menu.php :)\[code\]<?phpinclude ('includes/header.html');$link = $_GET['link'];if ($link == '1'){ include 'html/cold-starters.html';}if ($link == '2'){ include 'html/hot-starters.html';}if ($link == '3'){ include 'charcoal-grilled.html';}if ($link == '4'){ include 'chef-special.html';}include ('includes/menufooter.html');?>\[/code\]the retrieving of file works, but how do i setup a default include page? like setup the ('html/cold-starters') to be the first page when they go to the food-menu.php url? because so far ive only included the header and footer but not a default content page.Thanks Experts! :)
 
Back
Top