If you are doing all this for a client who doesn't like long passwords, and you are giving him an HTML file to sit on his computer, why not just embed the 'secret code' into the password field (you get to choose the password) and the guy just submits the password you chose from the HTML file. No extra scripting necessary :)