Stuart wrote:
>>> <?php include dirname(__FILE__)."/../header.php"; ?>
This generates a Fatal error: Cal to undefined function dirname() .... ????

I must be really dense...
What I don't understand in the above is this - dirname refers to what
directory? -- the directory of the file that is including? what if the
directory is the root directory of the site?

(_FILE_) = what? - (_filename.ext_) or (filename.ext) --- what file is
this, the file which is including the file header.php?

and what does the . mean and then "/../header.php" --- I don't
understand what to enter here

>>> Simple as!
>>> -Stuart
>> Ooooouuuuhhh... I think I just grasped my quandry by the tail...
>> I had not thought about it before, but the problem seems to be that my
>> header(s) do sometimes include links and/or other includes... so, I
>> think there is no simple solution to this. I simply have to make
>> different versions of such headers for different (sub)directories.
>> Thanks for the clarification.
> I said what now?
> By using dirname it doesn't matter where a file is included from so
> long as it's never moved to a different relative location to the stuff
> it includes.
> But if you've had some sudden enlightenment I wish you luck with it.
> -Stuart


Phil Jourdan ---

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to