My friends,
I wanna make a little code with a loop executing a cgi program at anoter
server ( like http://www.x.com/test.cgi?par1=b, where "b" will have the
loop's value )
This cgi will return a web page, wich I'd like to treat and pick a little part of it.
The doubts are:
- How execute a cgi at another server?
- How treat the result of it?
Best regards,
Claudio
How to execute a cgi at another server and treat the result
Moderator: General Moderators
You aren't really executing the script on the other server, you are just accessing it thru the web, the other server will execute it and return its result, you can use that result in your script..
If you are using PHP 4.3 or newer you can use $r = file_get_contents ('http://site/'); instead
Code: Select all
<?php
$result = implode ('', file ('http://example.com/some.cgi?beer=samadams'));
# do something with $result
?>