Jump to content

Include from another folder


Recommended Posts

I have a site that I have the same information on several pages in different folders.  Right now I have an include page in each folder and when I need to change the information on the include page, I have to do it for every folder, even though the information is all the same.  What I need to do is have one include page that I can modify and all the other pages in the different folders can include it.  I know I'm kind of rambling here but I hope I'm making sense.  I need to know how to include a file from one folder into a page from another folder.  Here's what I've tried so far and it didn't work... not sure what else to try.




The file that I'm trying to include this into is located at http://www.website.com/folder1/page.php ...


so include("include.inc.php") won't work... I have to specify what folder or directory to pull the include file from.


Sorry about the rambling and thanks in advance for any help.

Link to comment
Share on other sites

I figured it out! For those of you who may be having the same problem, here's the answer:


I have no idea why this isn't working:




But... this works fine:




Basically, for each "../" you put in front of the file name, it goes up one level.  So if you're include file is located at "http://www.website.com/include.inc.php" and the page you are including it on is at "http://www.website.com/folder1/folder2/page.php" you would do this:




Hope this helps someone.


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.