Re: PHP exec function.

From: Date: Sat, 11 Jun 2005 03:47:45 +0000
Subject: Re: PHP exec function.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-216842@lists.php.net to get a copy of this message
On Fri, June 10, 2005 3:04 am, Bob Snowdon said: > .... > $execstring="winposd.exe \"${physical}-${logical}-${parameter}\""; > $output=exec($execstring); > .... exec only returns the FIRST LINE of output -- perhaps winposd (whatever that is) prints a blank line first? For that matter, winposd might output to standard error... Does Windows have that??? If it does, how do you redirect?... It *MIGHT* be the same as some shells in Linux: $execstring="winposd.exe \"${physical}-${logical}-${parameter}\" 2&>1"; Or, it might not... At any rate, USE the extra arguments to exec to get, like, *ALL* the output, *PLUS* a super special bonus ERROR CODE returned from the Operating System. exec($execstring, $output, $error); if ($error){ echo "OS Error: $error\n"; echo implode("\n", $output); exit; } echo implode("\n", $output); To bastardize a quote: If you ignore the errors of the present, you won't even have the opportunity to repeat them. :-) -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#216842) next »