Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2005
    Location
    Belgium
    Posts
    2,492
    Tokens
    147

    Latest Awards:

    Default [PHP] Quick question

    How can I include a file which is in an upper folder, ex:

    -public_html
    --file.php
    --nl
    ---fileinside_nl.php


    how to include the file.php in the fileinside_nl.php

    I tried:

    Code:
    include("../../file.php");
    include($_SERVER['DOCUMENT_ROOT']."/file.php");
    none worked.

    any ideas ?

    oh btw, include the file via the full http:// link gave this link;
    Code:
    URL file-access is disabled in the server configuration

  2. #2
    Join Date
    Feb 2007
    Posts
    38
    Tokens
    0

    Default

    Code:
    include("../../file.php");
    include($_SERVER['DOCUMENT_ROOT']."../file.php");
    add the ../ to go up a directory?

  3. #3
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Should be just:

    PHP Code:
    include("../file.php"); 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •