Page 1 of 1

absolute path in phpbb

Posted: Mon Oct 12, 2015 11:28 am
by bradhulk
how would you include from document root in phpbb using absolute path like this

Code: Select all

$root = realpath($_SERVER["DOCUMENT_ROOT"]);

include "$root/inc/include1.php";

Re: absolute path in phpbb

Posted: Tue Oct 13, 2015 1:30 am
by Oyabun1
Don't know why you would want to use $_SERVER["DOCUMENT_ROOT"]? Look at just about any PHP file in the root of the phpBB installation. Most have at least one include in the first 20 lines.

Re: absolute path in phpbb

Posted: Tue Oct 13, 2015 8:05 am
by bradhulk
I have modified the overall_header.html file so that it displays a navigation menu/bar that is consistently used throughout my website...using absolute path would mean that I can use it and the various styles and images that it contains in every file without explicitly having to make a different navigation menu/bar for every directory and sub-directory furthermore it will mean that I can use this same method of obtaining files and their contents for other purposes throughout my modified forum.

Thanks again for the reply.

Re: absolute path in phpbb

Posted: Tue Oct 13, 2015 8:11 am
by bradhulk
found the answer in this viewtopic.php?f=46&t=2113447