Calling php code from php code on different server Calling php code from php code on different server curl curl

Calling php code from php code on different server


$output = file_get_contents('http://your.remote.server/page.php?args=12345');

Or you can use cURL. Keep in mind that when you're executing files in PHP you should limit the ability for other people to do so(ie. password protect the page/directory) and escape the shell arguments before running them.


$param['one'] = 1;$param['two'] = 2;file_get_contents("http://example.com/service.php?".http_build_query($param));


You can use the PHP cURL library to query scripts on remote servers.