Jump to content

Including a file in the root directory?


Garethp

Recommended Posts

Ok, so for some reason when I use

 

include "/Navigation.php";

 

It comes back with

 

 

Warning: include(/Navigation.php) [function.include]: failed to open stream: No such file or directory in /home/parkerco/public_html/Portfolio/innorvarite.php on line 25

 

Now, Navigation.php is at the root folder (public_html) and I'm trying to call it from any folder. How can I just make it an absolute without using http://parkercodes.com? I thought in absolute paths, putting / at the front meant root directory

Link to comment
https://forums.phpfreaks.com/topic/178097-including-a-file-in-the-root-directory/
Share on other sites

If Navigation.php is in a folder called public_html, then it is per definition not in the root folder...

 

I thought that in web directories the folder that is in the top level of the domain is considered the parent. IE, where parkercodes.com/index.php resides. Or is that only for HTML and Javascript?

That's only on the client side unless your server is chroot'ed. The root directory on a file system is always the top-most folder because of the tree like structure a filesystem is organized in.

 

Cool, thanks for the info.

 

And I know about that Kaboom. I just wanted to know how to do root, not parent. Just an addition of knowledge. Daniel0 fueled that expedition of knowledge

Archived

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.