我刚开始学习php。
我正在尝试使用 include_once 函数来在我的每个 php 站点中包含一个模板头。
(另外,这是我在这个网站上的第一篇文章,我不太确定它是如何工作的......刚刚意识到 4 空格缩进的东西)
我正在看这个视频: http ://www.youtube.com/watch?v=65gV8JOgWkQ&feature=relmfu
从大约 19:00 开始,我按照建议将此代码输入 DW CS5。
这是我的 index.php 文件:
<body>
<div align="center" id="mainWrapper">
<?php inlude_once("/Users/patrickmeaney/localhost/BobsSuits/template_header.php"); ?>
<?php include_once dirname("/Users/patrickmeaney/localhost/BobsSuits/template_header.php"); ?>
<div id="pageContent"> test</div>
<?php inlude_once("template_footer.php");?>
</div>
</body>
这是我的 template_header 页面:
<div id="pageHeader"><table width="100%" border="1">
<tr>
<td width="49%"><img src="style/bobssuitslogo.png" width="433" height="92" alt="Logo" /></td>
<td width="51%"> </td>
</tr>
<tr>
<td colspan="2"><a href="index.php">Home</a> <a href="#">Link 1</a> <a href="#">Link 2</a> <a href="#">Link 3</a></td>
</tr>
</table>
</div>