我有一些代码,我不知道为什么第3个包含语句不起作用。我已经尝试过更改订单了,它仍然是第三个永不工作的。
$filename = $includes_url . "php/LeagueFunctions2010.php";
if(file_exists($filename)) {
echo $filename . " found <br />";
include_once($filename);
echo $filename . ' included <br />';
} else {
echo "Filename: " . $filename . "<br />";
exit ("Missing file.");
}
$filename = $includes_url . "php/GetUserInfo.php";
if(file_exists($filename)) {
echo $filename . " found <br />";
include_once($filename);
echo $filename . ' included <br />';
} else {
exit ("Missing file. Filename:" . $filename);
}
$filename = $includes_url . "php/league_functions.php";
if(file_exists($filename)) {
echo $filename . " found <br />";
include_once($filename);
echo $filename . ' included <br />';
} else {
exit ("Missing file. Filename:" . $filename);
}
结果是:
/home1/chasiv/public_html/League/_includes/php/LeagueFunctions2010.php 包括 /home1/chasiv/public_html/League/_includes/php/GetUserInfo.php 包括
我在很多页面上使用了多个包含但由于某种原因这是失败的。
答案 0 :(得分:-1)
发现了这个问题。在league_functions&amp;中有重复的函数名称。 LeagueFunctions2010.php。这就是改变顺序无关紧要的原因。感谢大家的建议。