我在一些if/else语句中运行下面的代码,我在同一个文件中遇到了一个奇怪的问题,下面的代码工作正常,但是在另一个地方,如果它被调用,我会得到这个错误;
Warning: include() [function.include]: URL file-access is disabled in the server configuration in C:\webserver\htdocs\processing\process.friends.php on line 168
Warning: include(http://localhost/index.php) [function.include]: failed to open stream: no suitable wrapper could be found in C:\webserver\htdocs\processing\process.friends.php on line 168
$_SESSION['sess_msg'] = 'Please Enter the Correct Security Code';
$_GET["friendid"] = $friendid;
$_GET["p"] = 'mail.captcha';
$_GET["f"] = 'friend';
include ("index.php");
exit;为了澄清一下,我不打算同时运行这段代码2次,它更像这样;不只是这样,你也知道它们并不是同时运行的
if(something){
run the code above
}else{
run the code above
}如果重要的话,我目前正在windows PC上运行LAMP安装程序。
发布于 2009-08-07 17:52:52
删除代码中的"http://localhost“部分。根据经验,当您包含自己的文件时,应该从文件系统中包含这些文件。
include "./index.php";发布于 2009-08-07 17:55:08
只需删除部件,您就会好起来。
发布于 2009-08-07 17:53:37
好吧,我不知道你的问题的答案,但我必须问你为什么你觉得有必要包括一个基于URL的文件?
include('http://whatever.com/');可能非常危险。
如果您只是尝试输出由此生成的超文本标记语言,我建议您执行类似于echo file_get_contents('http://some/url');的操作。如果您尝试包含PHP代码,请使用系统路径
https://stackoverflow.com/questions/1246106
复制相似问题