Find the answer to your Linux question:
Results 1 to 3 of 3
Hey Everyone, So the big picture of what i'm trying to do is basically a user clicks a button on a web page and this results in an application being ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2012
    Posts
    4

    Launching graphical application from web server initiated action?


    Hey Everyone,

    So the big picture of what i'm trying to do is basically a user clicks a button on a web page and this results in an application being launched in the currently logged in X-Session (A media player or a browser or something along those lines). I'm not super well versed in web technologies but it seemed like the php "exec" command was exactly what i wanted, the ability to execute server side commands from a web initiated action. Problem is that the command is executed in the context of the php user, not the graphically logged in one. Thus using exec to launch a graphical application doesn't actually result in the program being visible. Now although i haven't tried this, presumably running the web server and php in the context of the logged in user should make this function in the way i want but i cant help but think there is a better way to accomplish this.

    Another idea i thought might work would be to use mysql to change a db value on some web action. Then write some kind of service or daemon that would be monitoring for this change and once observed, execute the appropriate commands such as launch graphical program X. Only this service would need to run as the logged in user so this seems a little more secure but maybe there's some obvious way this kind of thing should be handled and i just don't know about it, any input?

  2. #2
    Linux Newbie
    Join Date
    Nov 2012
    Posts
    211
    hi,

    php is executed on the server side; anything is executed on the server.

    javascript, on the other hand, is executed on the client (IRC).

  3. #3
    Just Joined!
    Join Date
    Sep 2012
    Posts
    4
    Quote Originally Posted by watael View Post
    hi,

    php is executed on the server side; anything is executed on the server.

    javascript, on the other hand, is executed on the client (IRC).
    Yes I'm aware of that, but that dosent really have anything to do with what I asked. Sorry if it wasent clear but I am trying to execute these commands on the server side, are you saying that php is the only way to accomplish what I'm trying to do?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •