【发布时间】:2014-04-07 03:57:17
【问题描述】:
我正在使用 php 包含。现在文件在子文件夹中。
错误是这样的:
警告:include(/headertop.php):无法打开流:第 11 行的 D:\ROLDANKING\xampp\htdocs\mysite\pages\print_design.php 中没有这样的文件或目录
HTML/PHP 文件是这样的:
<html>
<head>
<title>PRINT DESIGN</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="../images/art_favicon.png" type="image/x-icon"/>
<link rel="stylesheet" href="../css/body.css" type="text/css" media="screen"/>
</head>
<?php include ("headertop.php"); ?>
<?php include ("header.php"); ?>
<?php include ("nav.php"); ?>
<body>
<div id="contents">
</div>
</body>
<?php include ("footer.php"); ?>
</html>
【问题讨论】:
-
我将根据您的问题假设这些文件“headertop.php”、“header.php”等在其他地方?与 "D:\ROLDANKING\xampp\htdocs\mysite\pages\print_design.php" 结合的这些文件的完整路径在哪里或是什么
-
警告在文件名中显示了一个前导斜杠,那么你发布的代码怎么没有显示呢?
-
你好,杰克,我用过 (".../name/header.php") 或 ("/name/header.php) 等等...但它没有工作。