include() acts not really the way I've expected

Discussion in 'PHP' started by latehorn, Sep 28, 2005.

  1. #1
    Im programming a where every users can creates their own subdomains. My host require me to create a new dir in the basedir for every subdomain I want to have.. So my sollution was.. when a user creates a subdomain than a directory with an indexfile will be created. Then I add these rows into the indexfile(index.php):

    <?
    $path = dirname(dirname(__FILE__)); set_include_path(get_include_path() . PATH_SEPARATOR . $path);

    include("user_index.php");
    ?>

    So.. the user_index file is one dir below.. but when I try to get the url name of the file($dir_name = __FILE__; ) than it prints out the filename for the user_index instead of the filename of index.php..

    Iam confused.. Is there a better way to manage subdirectories??
     
    latehorn, Sep 28, 2005 IP
  2. theadud

    theadud Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Could you try to explain that in another way?
     
    theadud, Dec 13, 2007 IP
  3. Kaizoku

    Kaizoku Well-Known Member

    Messages:
    1,261
    Likes Received:
    20
    Best Answers:
    1
    Trophy Points:
    105
    #3
    Why don't you just do something like this?
    
    require_once("../../user_index.php");
    
    PHP:
     
    Kaizoku, Dec 13, 2007 IP