dongyi1982 2009-08-07 17:48 采纳率: 0%
浏览 25
已采纳

不能在php中包含文件

I am running the code below in some if/else statements, I have a weird issue in the same file this exact code below works fine, however in another area if it is called I get this error;

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;

And just to clarify I am njot trying to run this code 2 times at the SAME time, it's more like this; Not just like this but you get the point that they are not run at the same time

if(something){
   run the code above
}else{
   run the code above
}

If it matters, I am currently running a LAMP setup on a windows PC

  • 写回答

5条回答 默认 最新

  • dsce23640 2009-08-07 17:52
    关注

    remove the "http://localhost" part of your code. As a rule of thumb, when you include your own files, you should include them from your file system.

    include "./index.php";
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探