I have a php includes file in includes/template.php
. In this file, I have included two more files that are present in the same directory,(a header and footer file).
The files in the root directory that include the header and footer files work fine, its just the template.php
file that screws up, as it doesn't load the css and javascript files from css/style.css
and script/main.js
. I've looked online and found people that suggest using $_SERVER['DOCUMENT_ROOT'];
, but this doesn't work when I do it like this :
include($_SERVER['DOCUMENT_ROOT'].'/includes/header.php');
include($_SERVER['DOCUMENT_ROOT'].'/includes/footer.php');
Thanks in advance.