Using a script to check the login and username (html)

I made this named "confirm.sh":

#/bin/sh
#username and password are already given by the login form
if [ -s /home/alex/Desktop/Myfirstsite/allusers/$username ]; then
realpass=`cat /home/alex/Desktop/Myfirstsite/allpasses/$username`
if [ "$password" = "$realpass" ]; then
#continue with index.html
else
echo "Bad password"
fi
else
echo "Unknown username"
fi

because I wanted to make a program that checks if the clues given in the login form like this:

<table cellpadding=5 cellspacing=0 border=0>
<td style="padding:30"><br>
<form method="post" action="./confrim.sh" name=pform>
<input type="hidden" name="action" value="login">
<input type="hidden" name="user" value="deluxe">
<input type="hidden" name="hide" value="">
<table>
<tr><td><font style="font-family:times;color:Red" face="verdana,arial" size=-1>username?</td><td><input type="text" name="login"></td></tr>
<tr><td><font style="font-family:times;color:Red" face="verdana,arial" size=-1>pass?</td><td><input type="password" name="password"></td></tr>
<tr><td><font  style="font-family:times;color:Red" face="verdana,arial" size=-1>�</td><td><font face="verdana,arial" size=-1><input type="submit" value="Enter"></td></tr>
<td colspan=2><font face="verdana,arial" size=-1>�</td>
</table>
</form>
</td></tr></table></td></tr></table>
<tr><td colspan=2><font style="font-family:times;color:Red" face="verdana,arial" size=-1>DNot a member? click<a href="./register.html">HERE</a> to become</td></tr>
</html>

As you can see I have selected to start confirm.sh on click.In fact, when I click, the only thing it does is to download confirm.sh to my download folder:(:(:(.How can I told to the html code to call confirm.sh only to confirm the username and the pass? Or, could you suggest me a better way on hoe to do this?(I think I should use <script> but I am not so sure how to use it...)
Sorry for the (maybe) to big answers you meed to write but I am tottaly new to html and so it is quite difficult for me to understand how I have to think.I can use unix scripting quite easily so you dont need to explain me further on this issue!

you should use some cgi,php,jsp to accomplish such things
if you want the script to be executed you can do that from the above php...etc
they have inbuilt command to call a system command.

intially u need webserver apache, php ..

my prefernce is lamp,xamp,or wamp

use php to do that

Login PHP Script - Login PHP - Free Login PHP Script

Contrary to what phoenix_nebula said, it is possible to write CGI applications using shell scripting. But it's hard, as you don't have any of the nice features of other languages (like Perl or PHP) at your disposal, like parameter splitting, URL recoding, ...

For example, save this script as example.sh in your servers cgi-bin directory, make it executable for everyone, and then call it through the browser as http://localhost/cgi-bin/example.sh?param1=value1&param2=value2&param3=value%203

#!/usr/bin/ksh

echo "Content-Type: text/plain; charset=US-ASCII"
echo
export LANG=C

env

Somewhere in the output should be a line like this:

QUERY_STRING=param1=value1&param2=value2&param3=value%203

Those are your input parameters, which you'd have to split and decode yourself (in case you're wondering, %20 would be a space character).

If you really want to start on web programming, start with simple HTML (without any CGI), then go on to CSS, maybe JavaScript, and only then a CGI language like Perl, PHP, Ruby, or Python (in no particular order).

thx for your answers. I'll try them out!

why don't you use apache authentication?
htpasswd