View Single Post
Old 03-08-2006, 06:37 AM   #11 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,505
sde is on a distinguished road
try to keep it as simple as possible. yes, you can nest includes, but do you really need to nest the nav?

the header.php file will always be a single file, and if you need to change the nav, you can change it there.

now there may be exceptions, but a good rule of thumb is 'you should only use includes for code that you will re-use (or html you will type again in another file)'

so, for the navigation, to me it would make sense to put it in a seperate include perhaps if you were going to put it on the top and the bottom of the page. ( in the header and footer )

DJMaze brings up a good point. You can store your recipies in text files in a sub-directory named 'recipes.' Using that bit of php code in the middle ( which probably looks intimidating if you've never used php before ) you can dynamically call the recipe from the URL.

example: The recipe exists in the recipe directory: /recipe/grilled_lamb_with_mint_sauce.html

Now you can call it in the url by typing: http://cheffrankonline.com/recipe.ph...ith_mint_sauce

The PHP code just looks for the html file and includes it in your page. These recipe pages would not include the header and footer. They are the files being included into the recipe.php page.

Glad you got it working. The more time you spend with PHP, the less time you will spend maintaining your websites.
sde is offline   Reply With Quote