directory link problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amel86
    New Member
    • Apr 2010
    • 25

    directory link problem

    hello i have a simple question but i dont kno whow to handle.

    the problem is:

    i have a file (car.php) that i make include code like below:

    require_once('./global.php');
    require_once(DI R . '/includes/functions.php') ;
    require_once(DI R . '/includes/functions_forum display.php');


    this file (car.php) is same directory with global.php and includes folder.
    how if i want to create new folder and put car.php in this folder?

    of course the directory also change right?

    how to change the directory?

    thanks
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hey.

    You will just have to change the path to the included file to reflect the change.

    For a file in the same directory, you would use ./file.php. For a file in the parent directory you would use ../file.php; in the grand-parent directory ../../file.php; etc...

    Comment

    • amel86
      New Member
      • Apr 2010
      • 25

      #3
      atli, im still blur here.
      can i give real example and hope you will explain more clearly to me.. i have done what u already told me.. but the problem still same.

      the problem is i have a filename that is car.php. in this file, i make include code like below:

      require_once('./global.php');
      require_once(DI R . '/includes/functions.php') ;
      require_once(DI R . '/includes/functions_forum display.php');

      so, now i need to make car.php in a new folder as a car directory.
      in this case car directory will same level with includes directory.

      can u help me?

      Comment

      • code green
        Recognized Expert Top Contributor
        • Mar 2007
        • 1726

        #4
        You could use full path names throughout.
        Or register them with set_include_pat h. But I would only do this with common files used in multiple scipts

        Comment

        Working...