| 
	
 | 
 Posted by Daniel Klein on 12/23/07 14:43 
On Mon, 24 Dec 2007 00:06:32 +1000, "Vince Morgan" 
<vinharAtHereoptusnet.com.au> wrote: 
 
>According to the manual the file pointer that is returned by "popen()" can 
>be used by the following, fgets(), fgetss(), and fwrite() whereas you are 
>calling "fread()". 
> 
>> It works when I run this from a command prompt: 
>> 
>> C:\Inetpub\wwwroot\php>php popentest.php 
>> popen test... 
>> Hello World! 
>That is because hw.exe is outputting to the consol when it runs I would 
>think 
>http://www.php.net/popen 
 
 
Good catch. I changed the code to: 
 
 $fp = popen("cmd /c c:\\home\\cp\\hw.exe", "r+w"); 
 $myline = fgets($fp); 
 pclose($fp); 
 echo $myline; 
 
which envokes the program via 'cmd', but it still does not work in a 
web browser :-( 
 
I have already Google'd this to death and cannot find anything that 
helps. 
 
Daniel Klein
 
  
Navigation:
[Reply to this message] 
 |