benchivers
01-03-2004, 07:54 PM
I am having some problems with the popen function. I am trying to execute another php script using the popen function. The code i have written works ok (without error reporting) as I have tested it via the command line and it works fine. When using it via the command line e.g. 'php test.php' the output is successfully displayed on the screen, but when I execute test.php via my web browser, the output is not displayed. I have a feeling it's something to do with buffering, but I do not understand how it works. The code for the file 'test.php' is shown below:
<?php
$pipe = popen("php -f simpletest.php", "r");
$data = fread($pipe, 1024);
echo $data;
pclose($pipe);
?>
Any help with this matter would be most appreciated.
Many Regards,
Ben Chivers
<?php
$pipe = popen("php -f simpletest.php", "r");
$data = fread($pipe, 1024);
echo $data;
pclose($pipe);
?>
Any help with this matter would be most appreciated.
Many Regards,
Ben Chivers