Search code examples
phphtmlheaderincluderequire

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');
?>

Hello,

For some reason my header doesn't work.

My project consists with these directories

root --index.php --/login ----index.php --/includes ----header.html ----config.inc.php

My index.php displays the header correctly and inherits the config file perfectly, however the index.php in the login folder doesn't include the header. It does include the config though (require).

I tried several things like $_server['DOCUMENT_ROOT'] and stuff but I can't get that header to appear.


Solution

  • Just rename your file *.html to *.php

    like header.php, footer.php