Ok, so I read several questions and answers and none of them is working for me, so here it goes:
Firstly,
- My webhost doesn't allow:
$_SERVER['DOCUMENT_ROOT'] - All files are supposed to be uploaded under a folder called public_html - so it's http://mysite.com/pulic_html/myfolder/myfile.php
Now my issue is -
I have a master file - init.php under http://mysite.com/pulic_html/ and I have error files under - http://mysite.com/pulic_html/pages/error/403.php
How to I include init.php in 403.php.
- edit * Please note, public_html is not a part of the URL. I have shown it here to just show where my files actually exist.
These fail:
init.php
/init.php
./init.php
../init.php
init.phpis two folders up from403.php, so you'll need to go up two folders:../../init.php.