I’m trying to use absolute paths for php includes.
Right now I’m trying to do it like this:
include($_SERVER['DOCUMENT_ROOT'].'/sitefolder/apis/db.php');
but it doesn’t work since my site is not pointing to the root folder so I need to add a /sitefolder.
Is there a way to bypass this producing an absolute URL? Or is there a way to permit absolute URLs including?
Make a initialize.php.
And define your site root.
Include your includes file such as config.php, db.php.
And only include initialize.php to your files.