Jump to content

Recommended Posts

Hello everyone,

 

This is a fairly simple question, but the explanation of the question isn't... I'll do my best.

 

I have a site where my folders/sub-folders/files are arranged similar to this:

                    _                     

Root Folder -| Root-IncludeFile1.php

                    | Root-IncludeFile2.php

                    |                        _

                    |  Sub-Folder 1 -| Sub1-File1.php

                    |                        |_Sub1-File2.php

                    |                        _

                    | Sub-Folder 2 -| Sub2-File1.php

                    |                      |_Sub2-File2.php

                    |                        _

                    |_Sub-Folder 3 -| Sub3-IncludeFile1.php

                                            |_Sub3-IncludeFile2.php

 

Hopefully that makes sense to everyone.  Anyway, I know that to include a file that is in the root folder in file in a sub-folder, I can do this - include("../includefile1.php"); -but I'm trying to include a file that is in a sub folder in a file that is in another sub-folder.  For example, I'm trying to include "Sub3-IncludeFile1.php" in "Sub-File1.php"  I'm lost on this because I can't get it to work.  I'm not getting any error messages except to say that the variables located in the file that should be included are not found.

 

I've tried to do this: include("http://www.mysite.com/Sub-Folder3/Sub3-IncludeFile1.php"); and it doesn't work.  Can someone please point me in the right direction?  Thanks in advance for your help.

 

 

Link to comment
https://forums.phpfreaks.com/topic/227902-including-files-from-other-directories/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.