R: [PHP-WIN] Launching local apps from PHP
| From: | (Delbono) | Date: | Tue, 21 Nov 2000 12:26:40 +0000 |
| Subject: | R: [PHP-WIN] Launching local apps from PHP | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-4010@lists.php.net to get a copy of this message | ||
Hello,
I have a somewhat tricky solution.
SEVER SIDE_ + CLIENT SIDE
SERVER SIDE PART
http://www.server.com/your_srvrscript.php3?parameters
This script is the one that contains commands for your LOCAL application:
It could output something like this:
open(msword.exe);execCommand(NewDoc);write("Hello world!")
(these are commands you create, not those of any particular language.)
Then:
CLIENT SIDE PART
Install apache (or others) on your local machine:
create a script like this: (let's call this script: commander.php)
<html>
<meta autorefresh=30seconds>
<body>
<?
// this command returns the string: "open(msword.exe);execCommand... and so
on."
$string = fopen("http://www.server.com/your_srvrscript.php3?parameters");
$commands = explode(";", $string);
for ($a=0; $a<count($commands); ++$a){
if(!exec($commands[$a])){ $errors = 1;}
}
if($errors){ echo "Command execution not performed because of errors";}
else{ echo "Commands executed correctly!";}
?>
THEN (and here's the tricky part:)
Launch your browser and point it to:
http://localhost/commander.php
You'll grab commands from the server by using fopen
and you exec those commands LOCALLY because you launche the script Locally.
Remote catching continuity is ensured by the meta auorefres (so you don't
have to be on your local machine to get the server command, since the page
autorefreshes itself..) Or use cron.
Maybe not the best solution but it should accomplish the task.
Regards
Nicola
www.key5.com
-----Messaggio originale-----
Da: Lee Davis <L.S.Davis@exeter.ac.uk>
A: php-windows@lists.php.net <php-windows@lists.php.net>
Data: martedì 21 novembre 2000 12.54
Oggetto: [PHP-WIN] Launching local apps from PHP
>Apologies if this is a FAQ. I have been reading some of the COM discussions
>with interest.
>
>What I really want is to be able to run a PHP script that is sitting on a
>remote
>server and be able to have applications opened on my PC, not on the server.
>
>Suspect I am missing something obvious but is this possible?
>Thanks.
>
>
>Lee
>========================================================================
>Lee Davis, IT Services, University of Exeter
>Email: L.S.Davis@exeter.ac.uk
>Tel: +44-(0)1392-263960
>Fax: +44-(0)1392-211630
>WWW: http://www.exeter.ac.uk/
>Post: Laver Building, North Park Road, Exeter, Devon, EX4 4QE, UK.
>========================================================================
>
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
>For additional commands, e-mail: php-windows-help@lists.php.net
>To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>