Jump to content

[SOLVED] Wierd problem with includes


tamumech

Recommended Posts

Hi php freaks.

 

I am having a problem with passing values to my include files.

 

Here's the deal.  In one of my files I might write: (saving this as http://www.mysite.com/file.php)

 

$variable = 'value';
include("http://www.mysite.com/include.php");

 

Where include.php is:

 

echo "$variable";

 

And everything would work fine.

However, if include.php was saved in a different location such as: http://www.mysite.com/subdirectory/include.php, nothing would echo.  I would write:

 

$variable = 'value';
include("http://www.mysite.com/subdirectory/include.php");

 

I don't understand this because I am writing out the full URL.

 

Thanks in advance for your help!

Link to comment
https://forums.phpfreaks.com/topic/61699-solved-wierd-problem-with-includes/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.