2016-10-08 51 views
0

我不能包括我的頭

<?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 - --config.inc.php

我的index.php正確顯示頭並完美地繼承了配置文件,但是login文件夾中的index.php沒有包含頭文件。 它確實包含了配置(需要)。

我嘗試了幾個東西,如$ _server ['DOCUMENT_ROOT']和東西,但我不能得到該標題出現。

回答

0

只需將您的文件*。html的重命名爲* .PHP

像頭.PHP,footer.php

0

嘿嘗試使用此一個時期在盼着斜線的前面,也嘗試沒有句點或正斜槓

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