[K12OSN] launch an application via php script?

Petre Scheie petre at maltzen.net
Tue Nov 9 14:08:28 UTC 2004


If the objective is just to allow the kids to fire up, say, the gimp by clicking 
on an icon within Mozilla, one possibility might be to define a new MIME type 
within Mozilla and then set the helper application for that MIME type to be the 
gimp.  In the same way that PDF files automatically trigger xpdf (which you can 
change so that, say, AcroRead is triggered), you'd need to create some sort of 
file, give it a link on the webpage, and configure Mozilla to automatically 
launch the gimp when that file type is encountered.  The downside is you 
wouldn't want to make that file a .gif or .png or .jpg because that would 
interfere with Mozilla simply displaying those types which is presumably what 
you want it to do most of the time.  That's why you'll have to come up with your 
own file.  Call it .deb and tell Moz to launch the gimp whenever it encounters a 
.deb file (granted, Debian uses .deb files, but I'm assuming the kids won't 
really run into those.) ;-)

Petre

Debbie Schiel wrote:
> Hi - Thanks for the replies. What you all say about php being 
> server-side so can't activate local apps makes sense, so I tried a 
> different search, and found:
> 
> http://www.whirlywiryweb.com/q/%2Flaunchinie.asp
> "...LaunchinIE ActiveX Control that will enable HTML pages to start 
> whatever application on the client's machine, without security warnings.
> To ensure security, LaunchinIE needs to be carefully configured 
> client-side; due to this restriction it's only fit for intranet use."
> 
> But it seems like it's only for (ew!) internet explorer...
> 
> I'll keep looking though and reply with the solution when I find it.
> 
> Debbie
> 
> Huck wrote:
> 
>> 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>
>>>
>>>
>>
>> _______________________________________________
>> 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