Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I just want to make sure I'm getting it right:
When I used nested include/include_once, I noticed that, say:

/a.php        -> include("path/b.php");
/path/b.php    -> include("c.php");

This works fine. This, however,

/a.php        -> include("path/b.php");
/path/b.php    -> include("path/c.php");

does not. So, include takes a path relative to the included file, not
the top parent script, right? I mean, it should be so from what is
happening, but I remember I had some trouble with that some time ago,
maybe there are some version differences?


Re: include()

Quoted text here. Click to load it

If I'm not mistaken, it's part of your include_path setting. You'll
have problems if you ever want to keep your PHP files (libraries
and whatnot) out of web space. (I like php code out of web space,
should the web server ever be configured to show the source and
the source contains passwords, settings, etc..)

It'll also depend on safe_mode settings.

It can get rather confusing.

--                     Custom web programming
guhzo_42@lnubb.pbz (rot13)                User Management Solutions

Site Timeline