Forum Moderators: coopster
Anyway, when called directly from the browser, the Perl script gives HTML output. So that step is okay.
The "middle man," or the second PHP script in the description above, has the following code:
<?php
putenv('REQUEST_METHOD=POST');
putenv('QUERY_STRING=?id=5');
exec('/path/to/perlscript.cgi', $output);
array_shift($output);
echo(join('', $output));
?>
When calling this script directly from the browser, it gives the very same HTML output that the initial Perl script gave, which is also the desired result.
My problem is getting the first PHP script to run the PHP script above. Here's what I have in the first PHP file, which is really the only one that will ever be accessed by my visitors:
<?php
putenv('REQUEST_METHOD=POST');
exec('/path/to/phpscript.php', $output);
echo(join('', $output));
?>
When calling this script from a browser, all it returns is an error message: "Could not open input file:" That's all it says; I would have expected more but it doesn't even tell what file it's looking for.
I know this is a very roundabout way of accomplishing something, but it's a strange situation and it has to work this way. (I can explain why if that will help, but it gets confusing.) So how can I change that last code snippet so it will actually run the second PHP script and return the HTML from the Perl script at the end of the line?
Thanks in advance,
Matthew