include()

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lüpher Cypher

    #1

    include()

    Hi,
    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" );
    /path/c.php

    This works fine. This, however,

    /a.php -> include("path/b.php");
    /path/b.php -> include("path/c.php");
    /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?

    Thanks
  • nospam@geniegate.com

    #2
    Re: include()

    In: <9McVd.49174$W1 6.47800@trndny0 7>, =?ISO-8859-1?Q?L=FCpher_Cy pher?= <lupher.cypher@ verizon.net> wrote:[color=blue]
    >Hi,
    >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" );
    >/path/c.php
    >
    >This works fine. This, however,
    >
    >/a.php -> include("path/b.php");
    >/path/b.php -> include("path/c.php");
    >/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?[/color]

    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.

    Jamie
    --
    http://www.geniegate.com Custom web programming
    guhzo_42@lnubb. pbz (rot13) User Management Solutions

    Comment

    Working...