Re: Problem to run java command line with passthru()
| From: | Brian Clark | Date: | Thu, 29 Mar 2001 07:35:30 +0000 |
| Subject: | Re: Problem to run java command line with passthru() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-46030@lists.php.net to get a copy of this message | ||
Hi -Tuna-,
@ 1:42:21 AM on 3/29/2001, nicuc.ac.jp wrote:
...
> $java HelloWorld
...
> <?
> passthru("java HelloWorld") ;
> ?>
> But call through browser its return nothing. no out put , no error
> display. I test my script by log-in Telnet to call the PHP script
> directly.
Try backticks, but be sure to check user-supplied data. If you don't,
you could be putting your webserver into a "world of hurt" as the
country folks like to say in my part of the world.
<?php
$stdout =
/usr/bin/man -k make;
$lines = explode("\n",$stdout);
while(list(,$line) = each($lines))
{
print "<tt>$line</tt><br />";
}
?>
Other than that, try popen()
http://www.php.net/manual/en/function.popen.php
-Brian
--
PGP is spoken here: 0xE4D0C7C8
Please do not carbon copy me on list replies.