How can you protect your page, so not everyone can have access to it. There are a few possibilities:
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: