boxfire Posted December 3, 2003 Posted December 3, 2003 I'm finding for these to load correctly, I need to include public_html at the front end of the url that the include grabs, otherwise it can't find the file. Is there a way to get around that? Justin Quote
taznumber1 Posted December 3, 2003 Posted December 3, 2003 You should not have to put public_html at the front of your include file statement as long as it is in the same directory. The only time that I put that is if I am a few directories deep and I want to include a file that is in the root directory. Quote
boxfire Posted December 3, 2003 Author Posted December 3, 2003 I think I got if figured out. Thanks! Justin Quote
TCH-Don Posted December 4, 2003 Posted December 4, 2003 From the php tutorial section of this forum I found <?php include $_SERVER['DOCUMENT_ROOT']."/inc/header.php"; ?> to make your includes find the the path from the root folder. This way I am sure no matter where the page is located, the path is right. Quote
surefire Posted December 4, 2003 Posted December 4, 2003 You beat me to it, Don. Great job. The other method that I've seen work is to define the root or the path like so define ('PATH', '/this/path/file/dir/'); And then you can include it like include PATH . "header_file.php"; I did this from memory and didn't test it out. But look up 'define' at www.php.net if you are interested in using it. Quote
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.