我正在使用LAMP使用apache2和mySQL开发Web应用程序。
我有一个基本页面index.php,我想将我的header.php文件包括在'header_footer / header.php'中
我尝试使用<?php include("./header_footer/header.php");?>
,但不起作用。当我将header.php文件与带有<?php include("./header.php");?>
的index.php放在同一文件夹中时,它可以工作,但我希望将其放在其他文件夹中。
没有人知道为什么它要处理一个案件而不处理另一个案件吗?
尝试:
<?php include __DIR__ . '/header_footer/header.php'; ?>