我可以';我不包括我的信头


I can't include my header

<?php
require('../includes/config.inc.php');
include ('../includes/header.html');
$page_name = NAME;
$page_title = 'Home';
?>
<div  style="background-color:green;" class="container">
    <div class="section">
        <div class="row">
            <div class="col s6">
                <h3>Welkom</h3>
            </div>
            <div class="col s6">
                <h3>Welcome</h3>
            </div>
        </div>
    </div>
</div>
<?php include ('includes/footer.html');
?>

你好,

由于某种原因,我的头不起作用。

我的项目由以下目录组成

根--index.php--/登录----index.php--/包括----header.html----配置.inc.php

我的index.php正确地显示了标题,并完美地继承了配置文件,但是登录文件夹中的index.php不包括标题。不过它确实包含了配置(require(。

我尝试了一些东西,比如$_server['DOCUMENT_ROOT']之类的东西,但我无法让那个标头出现。

只需将文件*.html重命名为*.php

如header.php、footer.php

嘿,试着在前斜杠前面加一个句点,也试着不加句点或前斜杠

<?php
require('./includes/config.inc.php');
include ('./includes/header.html');
$page_name = NAME;
$page_title = 'Home';
?>
<div  style="background-color:green;" class="container">
    <div class="section">
        <div class="row">
            <div class="col s6">
                <h3>Welkom</h3>
            </div>
            <div class="col s6">
                <h3>Welcome</h3>
            </div>
        </div>
    </div>
</div>
<?php include ('includes/footer.html');
?>
< ?php include 'header.php'; ?>
ALL YOUR CONTENT HERE
< ?php include 'footer.php'; ?>

请查看此链接:-https://css-tricks.com/forums/topic/how-to-include-php-headers-and-footers-on-html-site/