【发布时间】:2016-01-09 17:39:18
【问题描述】:
我创建了一个名为 index.php 的文件,在与 index.php 相同的文件夹内有一个名为 "includes" 的文件夹>.
里面有两个PHP文件,head.php和header.php。问题是这两个文件没有包含在 index.php 中。现在,我搜索了整个 StackOverflow,但似乎找不到答案。
<!doctype html>
<html>
<?php include 'includes/head.php'; ?>
<body>
<?php include 'includes/header.php'; ?>
<div id="container">
<aside>
<div class="widget">
<h2>Widget Header</h2>
<div class="inner">
Widget contents
</div>
</div>
</aside>
</div>
</body>
</html>
【问题讨论】:
-
试试
<?php echo include ('includes/head.php'); ?> -
@Fred-ii-,我在使用名为 phpVMS 的 CMS 时遇到问题,因为它使用
php include而不是php echo include -
@ctabuyo 好吧,我们会看看 OP 要说什么(如果他们在这里阅读 cmets);但我对此表示怀疑。然而,更疯狂的事情发生了;-)
-
我不确定我是否正确使用错误报告功能,但此时没有报告错误。