2013-06-27 175 views
0

,所以我有一個頁面,標題是這樣的:接頭,包括不工作

<div id="header"> 
<div id="logo"></div> 
<div id="menubar"> 
    <nav> 
    <ul> 
     <li><a href="index.php">Início</a></li> 
     <li><a href="select_cafes.php">Cafés</a> 
      <ul> 
       <li><a href="select_cafes_murtosa.php">Murtosa</a></li> 
       <li><a href="select_cafes_torreira.php">Torreira</a></li> 
       <li><a href="select_cafes_monte.php">Monte</a></li> 
       <li><a href="select_cafes_bunheiro.php">Bunheiro</a></li> 
      </ul> 
     </li> 
     <li><a href="select_restaurantes.php">Restaurantes</a> 
      <ul> 
       <li><a href="select_restaurantes_murtosa.php">Murtosa</a></li> 
       <li><a href="select_restaurantes_torreira.php">Torreira</a></li> 
       <li><a href="select_restaurantes_monte.php">Monte</a></li> 
       <li><a href="select_restaurantes_bunheiro.php">Bunheiro</a></li> 
      </ul> 
     </li> 
     <li><a href="select_alojamentos.php">Alojamento</a> 
      <ul> 
       <li><a href="select_turismorural.php">Turismo Rural</a> 
        <ul> 
        <li><a href="select_turismorural_murtosa.php">Murtosa</a></li> 
        <li><a href="select_turismorural_torreira.php">Torreira</a></li> 
        <li><a href="select_turismorural_monte.php">Monte</a></li> 
        <li><a href="select_turismorural_bunheiro.php">Bunheiro</a></li> 
        </ul> 
       </li> 
       <li><a href="select_hoteis.php">Hotéis</a> 
        <ul> 
        <li><a href="select_hoteis_murtosa.php">Murtosa</a></li> 
        <li><a href="select_hoteis_torreira.php">Torreira</a></li> 
        <li><a href="select_hoteis_monte.php">Monte</a></li> 
        <li><a href="select_hoteis_bunheiro.php">Bunheiro</a></li> 
        </ul> 
       </li> 
       <li><a href="select_pensoes.php">Pensões</a> 
        <ul> 
        <li><a href="select_pensoes_murtosa.php">Murtosa</a></li> 
        <li><a href="select_pensoes_torreira.php">Torreira</a></li> 
        <li><a href="select_pensoes_monte.php">Monte</a></li> 
        <li><a href="select_pensoes_bunheiro.php">Bunheiro</a></li> 
        </ul> 
       </li> 
      </ul> 
     </li> 
     <li><a href="select_edificios.php">Edificios Municipais</a> 
      <ul> 
       <li><a href="select_edificios_murtosa.php">Murtosa</a></li> 
       <li><a href="select_edificios_torreira.php">Torreira</a></li> 
       <li><a href="select_edificios_monte.php">Monte</a></li> 
       <li><a href="select_edificios_bunheiro.php">Bunheiro</a></li> 
      </ul> 
     </li> 
     <li><a href="contato.php">Contato</a></li> 
    </ul> 
</nav> 
</div> 
</div> 

我dotn要重複這每一個頁面上,所以我試圖把這些代碼在一個文件中指定的頭.PHP。並在index.php我刪除該代碼和使用<?php include(header.php);?>

它不工作..有人可以幫助我嗎?

+1

它是如何工作的?錯誤? –

回答

0

你忘了引號 - <?php include("header.php");?>

0

您需要設置引號之間所包含的文件(header.php)。

<?php include('header.php');?> 

否則,你會得到一個錯誤。像這種情況一樣。