I want to execute a program on another server,
and access the results in my PHP program.
This seems like it should be simple, but I'm
experiencing brain lock.
This works, outside of PHP:
I enter this as my URL in the browser:
http://server.com/cgi-bin/qdir?fm=X&uid=myuid
and receive back a chunk of XML data.
I'd like to execute that EXACT same URL in my
PHP program, with the proper user id substituted
for "myuid", and get that chunk of data into a string
where I can parse it to my heart's content.
What I tried:
$output = exec('http://server.com/cgi-bin/qdir?fm=X&uid=myuid');
echo "<pre>$output</pre>";
or "system(---)" or backticks with the HTTP command, etc.
All return $output=(blank).
The fact that it's an HTTP command has me confused;
it's not quite the same as executing a command on the
local machine (exec('/cgi-bin/qdir[etc]'))....
What am I missing? I'm sure it's obvious and simple,
but I just can't picture it.