Ideally I'd just like to have one for the whole website, but I'm not sure how to make webpages futher into the directory tree access it. I've can put "..navigation.php" , and that works when the page is one page deeper than the include, but how do you do it when the page is four or five idrectoried deep? I tried doing this:

<?php include ("www.mywebsite.com/navigation.php"); ?> , but it didn't work.

What is the correct way of doing this so that I don't have to have a navigation.php page at each directory level?

Cheers

Shaun

Andrew Johnson

02-14-2008, 08:22 AM

Well you should be aware you need to specify a protocol...

http://www.website.com/navigation.php
www.website.com/navigation.php

bigbadroo

02-14-2008, 08:44 AM

Hi Andrew

Thanks for the info. I'm kind of new to includes.

I'm not sure I understand what I have done wrong - you say to specify a protocol, and then have two web addresses. i tried putting in the full weblink, but it didn't work. Have I misunderstood what you meant? can you please explain a little more for me?

Cheers

Shaun

Andrew Johnson

02-14-2008, 10:31 AM

Green = good, red = bad

<?php include ("http://www.mywebsite.com/navigation.php"); ?> will successfully include the file.

ahallicks

02-14-2008, 11:09 AM

Or, if you are in a directory above that navigation.php file you would do something like:

<?php include ("../navigation.php"); ?>

This steps up one directory into the one before. Of course, the other way to do this would be to have one page with all of your HTML, minus the content, then include the content so you keep everything else in one place rather than adding bits and pieces here and there

nikos101

02-14-2008, 11:19 AM

Or your could buy Dreamweaver and use its templating functionality

VIPStephan

02-14-2008, 02:36 PM

What is the correct way of doing this so that I don't have to have a navigation.php page at each directory level?