2011-03-13 78 views
0

我的形式通过PHP脚本和TEO文件之间创建:包含网址在PHP

  1. 的index.php
  2. 的header.php

index.php,我尝试在 ...

<div class="art-header-png"></div> 
<div class="art-header-jpeg"></div> 
<?php include("header.php"); ?> 
</div> 
<div class="art-nav"> 
<div class="l"></div> 
<div class="r"></div> 

and my header.php

<div class="art-logo"> 
    <h1 id="name-text" class="art-logo-name"><a href="#">Your Title Goes Here</a></h1> 
    <div id="slogan-text" class="art-logo-text">Your Slogan Goes Here</div> 
</div> 

但它没有显示header.php内的内容。 我如何使它工作?

+0

什么是显示错误? – kjy112 2011-03-13 06:21:41

+0

不显示任何内容.. izit可以使用<?php include(“header.php”);?>来链接页面之间的链接? – 2011-03-13 06:23:09

+0

显示什么意义呈现index.php是空白的? – kjy112 2011-03-13 06:23:51

回答

0

首先,将header.php放在与index.php相同的文件夹中,或者在使用include时指定相对于index.php的正确路径(同样适用于require)。

PHP Include

也请检查你的PHP正确配置为好。将以下代码行保存在一个php文件中。运行它,看看你是否得到php窗口:

<?php 
phpinfo(); 
?>