You have to have the output as part of the system or exec command,
Here's a ping function, maybe this will help:

  exec("/bin/ping -c3 $ipaddr", $output, $error);
        echo "<BR>\n";
    while (list(,$line) = each($output)){
        echo $line, "<BR>\n";
    }
    if ($error){
        die("OS Error: $error. Try using man ping, this also usually boils
down to
path/permissions.");
    }



----- Original Message -----
From: "Michael Robbins" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 04, 2001 11:53 AM
Subject: [PHP] system() and stdout


> I am trying to use system() to run an external command and have the output
> placed into a variable using:
>
> $output = system("/usr/local/bin/somecommand");
>
> the output is placed into $output, and it also places it instream with the
> HTML.  Anyone know why this is happening? or how to properly put data from
> STDOUT into a variable?
>
> Any help is appreciated.
>
> Mike Robbins
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to