PHP includes refererencing files from different directory
Ok, here's the deallio.
I've got several domains, some of them reference the same files. For example's sake, we'll call the current directory I'm working in "current."
The directory structure has all the domains on the same level, so I use for instance, the same footer file in each domain. Just say to keep things simple in this case that Util is a domain on the same level as all the others.
So, I've just been referencing it with for instance
This works fine. However, I've run into an issue when I try to include a file that contains other files (in particular images) that it refers to.
For instance I have a file called "navHeaders.html" that calls a few images inside of it. These images are in the same dir as navHeaders, the Util dir. So I have
This calls the navHeaders file just fine, but all of the images are broken since it's looking for them in the dir I'm working in (current) even though the file that's calling them is in a different directory. navHeaders calls simply "image.jpg" Shouldn't it look for this in the directory navHeaders is in? Is there any way to get around this without having to upload all the images into my current working directory (since that defeates the purpose of all these different domains referrincing the same file anyway)?
Thanks in advance.
Ok, here's the deallio.
I've got several domains, some of them reference the same files. For example's sake, we'll call the current directory I'm working in "current."
The directory structure has all the domains on the same level, so I use for instance, the same footer file in each domain. Just say to keep things simple in this case that Util is a domain on the same level as all the others.
So, I've just been referencing it with for instance
Code:
include "../../Util/public_html/footer.html";
This works fine. However, I've run into an issue when I try to include a file that contains other files (in particular images) that it refers to.
For instance I have a file called "navHeaders.html" that calls a few images inside of it. These images are in the same dir as navHeaders, the Util dir. So I have
Code:
include "../../Util/public_html/navHeaders.html";
This calls the navHeaders file just fine, but all of the images are broken since it's looking for them in the dir I'm working in (current) even though the file that's calling them is in a different directory. navHeaders calls simply "image.jpg" Shouldn't it look for this in the directory navHeaders is in? Is there any way to get around this without having to upload all the images into my current working directory (since that defeates the purpose of all these different domains referrincing the same file anyway)?
Thanks in advance.















