Entry
How do I execute a CGI script from PHP?
Jul 5th, 2000 20:07
Philip Olson, Matt Gregory, Corky Williams, landon@bradshaw.org
The simplest way to call an external cgi script:
<?
$result = exec("myprogie.cgi < $myinput 2>&1");
print($result);
?>
(<p><i>STDERR</i> is not handled and any output to will be passed to
the browser as part of the page.</p> <p>To stop this from happening you
can append '2>&1' on the end of your command-line to redirect STDERR to
STDOUT.</p>)
Another way to do this (better?) is as follows :
<?
echo @join (@file ("http://you.com/foo.pl"),"")
?>