note 9587 deleted from function.popen by felipe

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: stevet at linuxfan dot com 

----

In PHP3, I could do:

$query = "echo hello world | mycmd"
$fp = ($query, "r");

Under PHP4, this just produces "hello world | mycmd" as the output - the pipe is not executed.

Instead, use:

$query = "hello world";
$cmd = "mycmd";
$fp = popen($cmd, "w+");
fwrite($fp, $query);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.