Yes that will indeed run winword.... on the client machine.  Using exec()
will run winword on the host machine, which is what I believe Rainer wishes
to do.

However, it's documented somewhere that the exec() family of functions can't
work very well with programs with a GUI, only command line programs (ie it's
intended for linux and windows is only partially catered for).  The command
you want to execute it is
<?
Exec('"C:\PROGRAMME\MICROSOFT OFFICE\OFFICE\WINWORD.EXE"');

echo ("running");
?>

However, while this will indeed run office, the PHP parser will wait until
it closes again before continuing, so internet explorer at the client end
will hang and not continue to load until the server closes winword.  (ie,
echo "running" will never be reached).  I believe it is possible for exec to
continue on, but it involves routing the output of exec to a null pointer,
something I don't believe I ever managed to do (any suggestions anyone?)

On a happier note, what you are probably trying to achieve may be possible.
If you only want to extract data from a winword file, then take a look at
COM which I believe should do that.

Ross



-----Original Message-----
From: Webmaster [mailto:[EMAIL PROTECTED]]
Sent: 27 April 2002 22:18
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Re: executing an external program


If you have your mime type settings set correct in your Internet Explorer,
you just have to do a HTML call to a Winword document to make Winword
integrate with the browser !

The way you are trying now is the most dangerous one, because it can then
too execute other programs remotely !

This is also why most servers have the _exec command turned off....

C vd Veen


"Rainer Bruch" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> i am new in using and understanding php. need help in following issue:
> opening (executing) an external program (not a file) like "winword.exe"
with
> php4.
> my system-configuration:
> - windows 2000
> - php4 1.1.1
> - winword execution program-path is:
> "c:\programme\micosoft office\office\winword.exe"
>
> please, will somebody out there will help me with the complete php-code
> like:
> <?
> "code to execute the winword-program";
> ?>
>
> i have asked a so called specialist who gave the following (not
functioning,
> no error message) code:
> <?
> shell_exec("c:\programme\microsoft office\office\winword.exe");
> ?>
>
> thanks to all who will help me
> rainer
>
>



--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to