Results 1 to 6 of 6
I hope I have this in the correct section. I am looking for a way to execute a program and/or command from an HTML page. I cannot seem to figure ...
- 11-04-2011 #1Just Joined!
- Join Date
- Nov 2011
- Posts
- 2
Execute a command from an HTML page
I hope I have this in the correct section. I am looking for a way to execute a program and/or command from an HTML page. I cannot seem to figure out why I can't get it to work. I assumed it would be something simple like:
But apparently not. I'm sure its something simple that I'm missing, but can someone steer me in the right direction?Code:<html> <body> <a href="/usr/bin/palimpsest">TEST</a> </body> </html>
Thanks!
- 11-04-2011 #2
You need to use cgi-bin to execute stuff like that. Otherwise, use PHP.
Run shell script from web pagelinux user # 503963
- 11-04-2011 #3Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
Also, what are you trying to do, exactly? That command appears to attempt to launch the Disk Utility GUI - but it would open on the server, not the client's desktop. Also, it would probably fail to load at all b/c it does not have permission to access the local desktop X server (probably).
- 11-04-2011 #4
HTML cannot do this. It is simply not a part of HTML. However, depending on what you are trying to do, it may be possible.
If you are trying to launch a program on the computer of whoever is viewing your website, it is impossible. All that you deliver to the person looking at your site is HTML, and as I said, HTML cannot do this. Furthermore, Web browsers are specifically designed to prevent pages from executing programs, even by accident or via security vulnerabilities.
If you want to use a program to help generate the HTML that you send back to the viewer, this can be done. For instance, you could write a page that would list all of the programs installed in /usr/bin on the server and uses ls to accomplish this.
Doing this requires using a more complicated setup than using static HTML: it requires use of dynamically-generated web pages. Some examples of this are CGI, PHP, and Ruby on Rails. Using these is outside the scope of this thread, but good tutorials can be found online.DISTRO=Arch
Registered Linux User #388732
- 11-04-2011 #5Just Joined!
- Join Date
- Nov 2011
- Posts
- 2
Its sort of complicated what I'm trying to do, honestly. Basically I am trying to instead of use the desktop and applications menu and such, just run everything from a browser window. It doesn't have to run inside the browser window, just be able to be launched from it.
It doesn't have to be HTML. PHP would be nice to use too. Maybe I'll see about going that route if that would work.
- 11-04-2011 #6Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
It would not - see Cabhan's answer. You should look at using VNC - you can run a VNC server on a machine, then access that session via a VNC java applet, within a browser. Kind of what you want...


Reply With Quote