Yes, my mistake. Thanx for the quick reply. Just so I understand what's happening here __DIR__ grabs the current directory. So, let's say my header.php is in the views folder. require_once __DIR__ . "/path/../to/../header.php"; will append the current directory to this path. So, let's say the current directory is forum/views. So it would render as
require_once 'forum/views/header.php';
And when I try to include it from the root index.php instead of the one in the views folder it will render it as
require_once 'header.php';
Is this correct?
Now is there a way to add this to a config file so that I don't have to make my include files so verbose? How do I do that? I found that the $_SERVER["DOCUMENT_ROOT"] option was a nuisance because I'm developing using a local server, which means I have to change all my paths when I deploy. Thanx.