[K12OSN] launch an application via php script?

Huck dhuckaby at paasda.org
Mon Nov 8 17:27:00 UTC 2004


can you actually open an executable via  <a href> tag?
I tried...it asked me where I wanted to save the executable...
(was on a windows machine) dunno how linux will handle it...

Javascript might be able to launch something for you ?

--Huck, not even a mid-level web programmer =)

Petre Scheie wrote:

> I don't think this can be done, at least not with PHP (or CGI, etc.).  
> PHP is a server-side scripting language, meaning whatever is called is 
> owned by the server ID; I think you want, say, the gimp session to be 
> owned by the user who clicks on an icon.  I can't think of any way 
> that you could pass the $DISPLAY variable to the server, that the 
> server would be able to make sense of, such that the gimp would appear 
> on the correct terminal.  The problem, as I see it, is one of context: 
> clicking the icon happens in the user's context, but it triggers a 
> (PHP) script that runs in the web server's context.
>
> Even if you could have apache call the gimp and pass it the correct 
> display, you still have the issue of who owns and therefore controls 
> the gimp pid.
>
> It's an interesting concept, though, and I'd love to be proven 
> wrong...but I just can't see how one would make it work.  I don't 
> think you can get there from here.
>
> Petre
>
> Debbie Schiel wrote:
>
>> Hi, This is for the PHP gurus...
>>
>> Is there a way to launch an application (eg: 'gimp') via a php script?
>>
>> I'm thinking of an intranet page for Preppies (kindergarten) with 
>> icons linked to flash games on external sites but also icons linked 
>> to internal applications. So I would need something like:
>>
>> <a href="go.php?launch=myapp">TUX PAINT ICON</a>
>>
>> and then
>>
>> <? if ($launch==myapp) {
>>             some php script here...
>>         }
>> ?>
>>
>> I've tried exec() and shell_exec() without success.
>> Any ideas?
>>
>> Thanks,
>>
>> Debbie
>>
>> ps - is this considered 'off topic'?
>>
>
> _______________________________________________
> K12OSN mailing list
> K12OSN at redhat.com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>
>
>




More information about the K12OSN mailing list