Quote from: rossco at Nov 05, 2010, 03:14 PM
Hello, I have wrote a plugin that I would like to use on several sites but distribute it from one location.
Can I create a plugin in each modx evo 1.0.4 site using cURL to collect the PHP file? I thought about cURL since the sites will need to access the file from another web server.
I have tried but the code isn’t being executed. I wonder if this is possible.
Executing php code from other WEB server
is not safe.
But if you want to get your php code from other web server you should save it in file with non-php extension (like mycode.phps or mycode.txt). In this case apache (or other web server) will send it "As is" without php-handling.
To include remote php code:
include 'http://myserver.com/myfile.phps';// was deprecated(?)
// or
$mycode = file_get_contents('http://...');
eval ($mycode); // it's work!
$_SESSION and other predefined PHP vars are available both in included scripts and in "eval code"
Good luck!