I know some of you will say this is not a good idea because of security reasons but unless I figure out a better way to update hundreds of sites at once, it will have to do.
I have allow_url_include = 1.
The problem is that using the php include function makes the script run on the remote machine and only outputs the "result" onto the domain the user is accessing. Any variable or function declared in the included php file will be unsusable in the rest of the code.
Simple exemple of what I'm trying to do.
Content of: mainwebsite.com/include.php
Code: Select all
<?
$something = "yes";
?>Code: Select all
<?
include("http://mainwebsite.com/include.php");
echo $something;
?>the word "yes" written on the screen.
I'm open to any suggestion to make this work but please don't suggest something that would imply completely re-writing the way the website works.
Can it be done using some kind of ftp include? Is there anyway to make the domain on which the include file is stored appear as "local" to all my remote domains and therefore include would work as if the files were stored locally?
Thanks for you time and suggestions.