Reputation: 208
I am just setting a project up, and I cannot make my header work from a subfolder.
From subfolder/mypage.php I would like to call the resources/includes/header-test.php. It have always worked for me to do that like this:
<?php include $_SERVER['DOCUMENT_ROOT'].'/resources/includes/header-test.php'; ?>
I cannot solve this, so does anybody have a suggestion how I can do this?
Upvotes: 1
Views: 36
Reputation: 61
try this:
<?php include __DIR__.'/../resources/includes/header-test.php'; ?>
Upvotes: 2