我的php页面将显示我的html头包括在dreamweaver预览,但不是在浏览器中


My php page will display my html header include in the dreamweaver preview but not in a browser

我的php文件中的include代码片段如下:

<div id="header">
  <!--#include virtual="includes/frontpage_header.html" -->
</div>

我的frontpage_header.html代码是这样的

<div style="float: left; width: 30%;"><a href="../index_new.php"><img id="headerlogo" src="../images/DynamicHomes45th.png" alt="Dynamic Homes Logo"/></a>
</div>
<div style="float: left; width: 33%;">
<h1>QUALITY CUSTOM BUILT HOMES</h1>
</div>
<div style="float: right; width: 33%;">
<div id="headernav">
  <div id="whybuild">
    <h2>WHY BUILD DYNAMIC</h2>
    <img src="../images/whybuildicon.png" alt=""/> </div>
  <div id="gallery">
    <h2>GALLERY</h2>
    <img src="../images/galleryicon.png" width="43" height="43" alt=""/>
    </div>
</div>
</div>

就像我在标题中说的,它将显示在我的dreamweaver的设计视图中,而不是在浏览器中。

试着像这样用Php包含它:

<div id="header">
    <?php include("includes/frontpage_header.html"); ?>
</div>

考虑到您在项目的其他地方使用Php,将frontpage_header文件设置为。Php而不是。html也是值得的。