我只是设置一个项目,我无法从子文件夹中使用我的标题。
从子文件夹/ mypage.php我想调用resources / includes / header-test.php。对我来说,这样做总是这样:
<?php include $_SERVER['DOCUMENT_ROOT'].'/resources/includes/header-test.php'; ?>
我无法解决这个问题,所以有人建议我如何做到这一点?
答案 0 :(得分:2)
试试这个:
<?php include __DIR__.'/../resources/includes/header-test.php'; ?>