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! Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
tamumech Posted July 25, 2007 Author Share Posted July 25, 2007 Ok, got it. SOLVED. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.