SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: require();

  1. #1
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    require();

    i have folder below my forums and in the files in there i need to include vBulletin's global.php but when i do that. i get the error that it can't find config.php. i know why this happens but i need to know how to fix it or go around it

  2. #2
    Grumpy Mole Man Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,067
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm afraid you haven't really given us enough information - you say you know why this happens, so tel us why and we might be able to help you further.

  3. #3
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it happens because if i say require("../../forum/global.php"); and inside global.php it has require("./admin/functions.php"); it will look for the admin/functions inside the directory of the current file and not from the forum directory

  4. #4
    Happy Holidays !! Paul S's Avatar
    Join Date
    Mar 2001
    Location
    Mexico
    Posts
    1,287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by MrLister
    it happens because if i say require("../../forum/global.php"); and inside global.php it has require("./admin/functions.php"); it will look for the admin/functions inside the directory of the current file and not from the forum directory
    In that case, why you don't you try with absolute paths?

    Paul

  5. #5
    Victory shall be mine tubedogg's Avatar
    Join Date
    Mar 2001
    Location
    Medina, OH
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Or try
    chdir("../../forum");
    require("global.php");
    Then it should look in the forum directory instead.
    Kevin

  6. #6
    Non-Member MrLister's Avatar
    Join Date
    Feb 2001
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thx tubedogg that worked!


Bookmarks

Posting Permissions

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