| Žed Eye Media - Richard Grove 2004-07-26, 8:57 am |
|
"steve" <UseLinkToEmail@dbForumz.com> wrote in message
news:10g5ct6bktt76bd@news.supernews.com...
> I am quite frustrated with php's include, as I have spent a ton of
> time on it already... anyone can tell me why it was designed like this
> (or something I don't get)?
>
> The path in include is relative NOT to the immediate script that is
> including it, but is relative to the top-level calling script.
>
> In practice, this means that you have to constantly worry and adjust
> paths in includes, based on the startup scripts that call these
> lower-level scripts.
>
> Why is the include path not simply relative to the script that is
> immediately including?
>
> --
> http://www.dbForumz.com/ This article was posted by author's request
> Articles individually checked for conformance to usenet standards
> Topic URL:
http://www.dbForumz.com/PHP-Frustra...pict132935.html
> Visit Topic URL to contact author (reg. req'd). Report abuse:
http://www.dbForumz.com/eform.php?p=443884
I use a little script that looks for the include folder and then creates a
$incdir variable.
This is then used in each script.
include_once("$incdir/databaseconnectionorsomething.php");
Regards
Richard Grove
|