我是非常新的php,我有一个页面,其中5个包含位于一个目录(称为包含)中,一个位于我的页面所在的位置(称为联系人
我的文件结构就像这样
| Index.php(包括工作精细)
|含
|联系|的index.php
联系人文件夹中的Index.php似乎只显示form2.php include
<?php include("../../head.php"); ?>
</head>
<body>
<?php include("../../header.php"); ?>
<!-- container -->
<div id="container" class="container_12">
<!-- full width Header-->
<?php include("../../billboard.php"); ?>
<!-- Main Content-->
<div class="grid_8">
<?php include("../form2.php"); ?>
<div class="clear"></div>
</div> <!--main content close-->
<!-- Side Bar-->
<?php include("../../sidebar1.php"); ?>
</div>
</div>
<!--containter close-->
<div id="topspace" class="grid_12"></div>
<?php include("../footer.php"); ?>
</body>
</html>
出现的错误:
警告:include(../../ head.php)[function.include]:无法打开流:/home/superinj/public_html/gholami.co.uk/callback/index中没有此类文件或目录第20行的.php
警告:include(../../ head.php)[function.include]:无法打开流:/home/superinj/public_html/gholami.co.uk/callback/index中没有此类文件或目录第20行的.php
警告:include()[function.include]:打开包含的'../../head.php'失败(include_path ='。:/ usr / lib / php:/ usr / local / lib / php ')在第20行的/home/superinj/public_html/gholami.co.uk/callback/index.php
警告:include(../../ header.php)[function.include]:无法打开流:/home/superinj/public_html/gholami.co.uk/callback/index中没有此类文件或目录第26行的.php
警告:include(../../ header.php)[function.include]:无法打开流:/home/superinj/public_html/gholami.co.uk/callback/index中没有此类文件或目录第26行的.php
警告:include()[function.include]:无法打开包含的'../../header.php'(include_path ='。:/ usr / lib / php:/ usr / local / lib / php ')在第26行的/home/superinj/public_html/gholami.co.uk/callback/index.php
警告:include(../../ billboard.php)[function.include]:无法打开流:/home/superinj/public_html/gholami.co.uk/callback/index中没有此类文件或目录第33行的.php
警告:include(../../ billboard.php)[function.include]:无法打开流:/home/superinj/public_html/gholami.co.uk/callback/index中没有此类文件或目录第33行的.php
警告:include()[function.include]:打开包含的'../../billboard.php'失败(include_path ='。:/ usr / lib / php:/ usr / local / lib / php ')在第33行的/home/superinj/public_html/gholami.co.uk/callback/index.php 需要谈论抵押贷款吗?我们可以联系你..
(form2.php出现在这里)
警告:include(../../ sidebar1.php)[function.include]:无法打开流:/home/superinj/public_html/gholami.co.uk/callback/index中没有此类文件或目录第54行的.php
警告:include(../../ sidebar1.php)[function.include]:无法打开流:/home/superinj/public_html/gholami.co.uk/callback/index中没有此类文件或目录第54行的.php
警告:include()[function.include]:无法打开包含的'../../sidebar1.php'(include_path ='。:/ usr / lib / php:/ usr / local / lib / php ')在第54行的/home/superinj/public_html/gholami.co.uk/callback/index.php
警告:include(../ footer.php)[function.include]:无法打开流:/home/superinj/public_html/gholami.co.uk/callback/index.php上没有这样的文件或目录第67行
警告:include(../ footer.php)[function.include]:无法打开流:/home/superinj/public_html/gholami.co.uk/callback/index.php上没有这样的文件或目录第67行
警告:include()[function.include]:无法打开'../footer.php'以包含(include_path ='。:/ usr / lib / php:/ usr / local / lib / php')第67行/home/superinj/public_html/gholami.co.uk/callback/index.php
我可以访问两台服务器并尝试上传到两台服务器,两次都会收到错误
我缺少什么? 感谢
答案 0 :(得分:3)
如果是上面的一个目录,请使用../
代替../../
示例:
<?php include("../head.php"); ?>
这就是表格出现而其他表格不出现的原因:)
答案 1 :(得分:1)
您似乎忘记在路径中添加“/ Includes /”
<?php include("../Includes/head.php"); ?>