【发布时间】:2012-12-15 13:05:23
【问题描述】:
这是我在functions.php 中的代码:
<?php
$id = 10;
$html = file_get_contents("inc-star-rating.php?id=$id");
echo $html;
?>
这是inc-star-rating.php的内容:
<?php
$id = $_GET['id'];
echo "<div>I have the ID of $id</div>";
?>
它们都在我服务器上的同一目录中,为什么会出现以下错误?:
警告:file_get_contents(inc-star-rating.php?id=10) [function.file-get-contents]:无法打开流:没有这样的文件或 目录
【问题讨论】:
-
因为没有名为
inc-star-rating.php?id=10的文件。
标签: php include file-get-contents