[thelist] PHP -Self-finding navigational includes

Fred D Yocum fdy at mcc.org
Thu Jul 28 10:28:16 CDT 2005

Excellent, looks simple and neat! Presumably it could also be above the 
head in each document?

F D Yocum

[ This email was sent to: Fred D Yocum <fdy at mcc.org>, Evolt 
<thelist at lists.evolt.org> ]
[ On  07/28/2005 10:16:22,   Jens Brueckmann <jens.brueckmann at gmail.com> 
wrote:  ]

2005/7/28, Fred D Yocum <fdy at mcc.org>:
> [...]need  a function/routine that figures out where the page (with the
> included navigational side bar) is within the directory structure and
> writes the paths accordingly.[...]
> Can anyone point me in the direction of an efficient way of doing this?

Hi Fred,

I use a tiny include consisting of the following code snippet, sitting
in every directory:

$subsCount = substr_count($_SERVER["PHP_SELF"],"/") - 1;
$i = 0;
while ($i++ < $subsCount) { $ROOT .= "../"; }



Jens Brueckmann
[  End of Original Text ]

More information about the thelist mailing list