HTML Code to Run a Script from Remote Unix Host

Hi All,

Noticed few posts around this but coudnt get exatcly what i wanted. Thanks for your help again.

I have a script running on a remote machine and i normally ssh from putty and run the script manually.

Is there anyway that i can write an HTML Code with a button so taht when I Click on a Button it will start the Script.

Can we pass arguments from HTML page? eg:- this Script has a Parameter, i would like to pass that from HTML page..

Did i ask this question in a right forum ?

Regards,
Robin

First Question:

There are several ways to do this, the most common is to write a CGI script that your html page will use as the "Action" of a form. You would need to read up on forms in html, and CGI.
This requires (possibly) changes to your web servers configuration file to set a "CGI" script path and the proper permissions.

Another avenue would be PHP and it's "system()" function. Again, requires adequate permissions. PHP runs the command as the user that web server is running as. That can be tricky to get right as well.

The bigger question is it the possible risk of exploit? Running a system command from a web page is usually ill advised. You are opening the door to all kinds of unexpected behavior, not the least of which is being hacked.

Second Question:

Certainly, html forms can use the "GET" or "POST" method to pass parameters. Usually a text box, or check boxes, or even a drop down can be used to select the parameters you want in the form. Then when you click your submit button, these values are sent to the "action" script/page for procession using the "GET" or "POST" method.

I would start by reading up on html forms, once you can get the form to submit to another page and you can print the correct strings on the resulting page... then start looking into php or cgi.