After the third time reading your post, I figured out what you were talking about. A right good idea it is too. I am not sure if I'm going to use it, but's it's worth some serious consideration.
By the way, "Server Overhead" is a good term for it, if not THEE term.
Lastly, for the question of "what's the use of $DOCUMENT_ROOT anyway". Well, I don't really know how to answer the question other than say it would certainly seem to make sense particular circumstances. Besides, the other options didn't solve the problem either. I used those first.
Perhaps, to put it another way, I wanted a clean way of being able to call or include THE SAME MENU file from ANYWHERE in the document/directory tree and NOT have any links broken, regardless of depth.
Now the more I type, the more I can see a way of doing this using your method in conjunction with the $DOCUMENT_ROOT variable.
It would have to use absolute path information, but doing so using the $DOCUMENT_ROOT variable should still make the site somewhat portable (from server to server).
Oh well, you've helped a lot.
Out of curiosity, are you using Windows?
You're slashes are going the wrong way.
Later on,
Morpheus
André Gonçalves wrote:
I'm not really sure,
but I thought some roads out of your coder-block:
You can use a wraper file 'index.php' wich is only the file i link to
index.php?usr=1&s_id=2&area=form&form_id=1
this index.php should have no output, but it should decide wich files to include based on variables suchs as $area='form' or $pg=home
your menu could look like
<a href="index.php?pg=home">HOME</A>
<a href="index.php?pg=1">OP1</A>
<a href="index.php?pg=2">OP2</A>
I use a multimension array like this one to trigger all the right includes in the right $context and by the right order...
$pg_inc['home'][0]='pub/usrvars.php3'
$pg_inc['home'][1]='pub/banner.php3'
$pg_inc['home'][2]='tables/stdbegin.php3'
$pg_inc['home'][3]='menus/homemenu.php3'
$pg_inc['home'][4]='flashsite/welcome.php3'
$pg_inc['home'][2]='tables/stdend.php3'
$pg_inc['home'][5]='footer.php3'
it's handy to manage page cmpositions like in a multi-columns site, with 4!!!! or more !!!!!!!!! levels of nested tables a....