tomdelonge Posted November 24, 2008 Share Posted November 24, 2008 alright, i know what directories are, but i have a few questions about how they work. (i moved a couple files around, and a couple things on my site "broke". really, the correct file isn't being identified. so my site is set up like so: aboutus.php might say something like: include "include/php/header.php" //xhtml here include "include/php/footer.php" and then in the "footer.php" file, it includes ../javascript/statistics.php now, all my files are in different folders. which file is referencing others? are they all from about us, and anything included needs to be from the top level directory? i just don't get it... Quote Link to comment https://forums.phpfreaks.com/topic/134130-directories-i-dont-understand-them/ Share on other sites More sharing options...
jordanwb Posted November 25, 2008 Share Posted November 25, 2008 In the file aboutus.php its trying to find /include/php/header.php, which it can't find. You'd need to either put those files back where they were, or change the include path so that its relative to where the file is. Quote Link to comment https://forums.phpfreaks.com/topic/134130-directories-i-dont-understand-them/#findComment-698317 Share on other sites More sharing options...
premiso Posted November 25, 2008 Share Posted November 25, 2008 This is why I use the $_SERVER['DOCUMENT_ROOT'] infront of all my files. That way no matter where it is called from it should work. My 2 cents. Quote Link to comment https://forums.phpfreaks.com/topic/134130-directories-i-dont-understand-them/#findComment-698321 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.