You can use JavaScript to do the checking. Because scripts must be
downloaded to the browser, there is a greater risk that someone can
retrieve the passwords. You can improve security by placing the script in
a separate file, that is referenced by the SCRIPT tag, using the SRC
attribute.
There's another problem with using scripts, and it occurs when the
browsers does not support JavaScript, or when the user has disabled
support. In that case the check will not be activated at all, and the user
will not be able to go to protected page, even if they type in the correct
password.
I have two techniques that both use JavaScript:
- Combine the userids and passwords to a HTML page name
- Store the userids and passwords in the scripts