Ok, so the first thing that "we" need to know in order to help you is to understand why you actually want to do that - in fact, it is non-obvious why it has to be some kind of "HTML script" - what's for example wrong with a terminal script? This is important to know as you might have good reasons for requesting it in HTML form. You just haven't stated them here. As such reasons are normally tremendously important to keep in mind right from the start, you will need to state them here to get good answers.
Then, provided that you really want to do it in a web-based way, state what you already have: a web server installed somewhere, which scripting languages it supports right at the moment, etc.