Hi everybody,
I need a solution to run some PHP code on multiple domains. The domains are hosted on different servers, and the base PHP code isn't on any of them, let's say a dev server.
All I could come up with was using file_get_contents on a file hosted on the dev server, and running that code with eval. So on every domain i have an index.php file with :
error_reporting(0);
$code = file_get_contents("http://www.mydevserver.com/main.php");
if ($code === false) {
// treat error
die();
} else {
// run code
eval($code);
}
So far I have only one file with a few functions in it, but things could get more complex in the near future. And I have to mention I'm not only handling data, but also presentation, so I don't know if an API could help.
Any insights on how I could do this better ?
I have to point out that unfortunately all I have is FTP access on the remote servers and I can't get anything else.
Thank you !