Unable to include file in php

I am running the code below in some if / else statements, I have a strange problem in the same file, this exact code below works fine, however in another area, if 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 that I'm trying to run this code 2 times at the same time, it looks more like this; Not like you, but you understand that they do not start at the same time.

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

If that matters, I am currently running LAMP setup on a Windows PC

+3
source share
5 answers

remove some of the http: // localhost code . Typically, when you include your own files, you should include them from your file system.

include "./index.php";
+10
+2

, , , URL?

include('http://whatever.com/'); .

HTML- , - echo file_get_contents('http://some/url');. PHP-,

0

? ?

include ('http://...'); PHP HTTP- - . , include ('index.php');, .

0
0

Source: https://habr.com/ru/post/1714638/


All Articles