Alright I have defined some constants for my root directory of files.
define("ROOT_DIR", "/new_work/");
define("ROOT_URL", "http://" . $_SERVER['HTTP_HOST']."".ROOT_DIR."");
This function works until I use it in a sub-directory. Now I figured out that I had to turn on allow_url_include on my php.ini settings. I did that and now works. (session.php includes constants.php which contains the above constants)
include("../session.php");
include("".ROOT_URL."templ/header.php");
Now I'm making my pages all on my computer and personally hosting them before I upload anything to my Webhost. I've read that a lot of web hosts (and Yes I do plan on contacting mine) have this option turned off . I am having trouble figuring out how to do this without linking it by URL . I can do just the ROOT_DIR but then my pages in the sub-directories link wrong. Sub-directories will then link as /dir/include when it's supposed to be just /include/ from the main directory. Any tips on a better way to do this without remotely linking?