I have been trying to capture output
from an external program under Windows 2000 Server running PHP Version 4.0.4pl1, but I have not been having any luck. Any ideas?
<?php
// This could be "dir", a program name, etc.:
$Command = "echo It works!";
// None of these seem to do what I wanted:
$Result = passthru($Command) or $Result = "None! "\$Result = passthru(\$Command)" did not work!";
echo "<P><SPAN CLASS=\"Bold\">\$Result:</SPAN> $Result</P>\n";
$Result = system($Command) or $Result = "None! "\$Result = system(\$Command)" did not work!";
echo "<P><SPAN CLASS=\"Bold\">\$Result:</SPAN> $Result</P>\n";
$Result = `$Command` or $Result = "None! "\$Result = `\$Command`" did not work!";
echo "<P><SPAN CLASS=\"Bold\">\$Result:</SPAN> $Result</P>\n";
?>