tamumech Posted July 25, 2007 Share Posted July 25, 2007 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 More sharing options...
trq Posted July 25, 2007 Share Posted July 25, 2007 Includes should be called via paths not urls. When called via a url the php is processed in a seperate process and the output is then included. Link to comment https://forums.phpfreaks.com/topic/61699-solved-wierd-problem-with-includes/#findComment-307161 Share on other sites More sharing options...
Caesar Posted July 25, 2007 Share Posted July 25, 2007 Use relative paths. You can't include PHP remotely from another server....not the way you're doing it, anyway. Link to comment https://forums.phpfreaks.com/topic/61699-solved-wierd-problem-with-includes/#findComment-307163 Share on other sites More sharing options...
tamumech Posted July 25, 2007 Author Share Posted July 25, 2007 Ok, got it. SOLVED. Link to comment https://forums.phpfreaks.com/topic/61699-solved-wierd-problem-with-includes/#findComment-307237 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.