Password Protect any page on your website (for free!)

It’s easier than you think to password protect your web pages. It doesn’t matter what your web maker is, or what system you run.

Firstly, go onto your webmaker and go onto the page you wish to password protect.

Now, you must add the following HTML Code into theĀ Header of your page:

<SCRIPT language="JavaScript">
<!--hide

var password;

var pass1="Whatever You Want The Password to Be";

password=prompt('Please enter your password to view this page!',' ');

if (password==pass1)
  alert('Password Correct! Click OK to enter!');
else
   {
    window.location="Wrong Password Site Address Here";
    }

//-->
</SCRIPT>

Replace

var pass1="Whatever You Want The Password to Be";

with the password of your choice.

Now make a new page on your website telling the user that the password they have entered is incorrect. Our example:

Replace

window.location="Wrong Password Site Address Here";

with the URL of the page you just created. When the user enters an incorrect password, then they will be taken to that page.

The password protection will look like:

Leave a Reply

Your email address will not be published. Required fields are marked *

CAPTCHA Image

*

Protected with IP Blacklist CloudIP Blacklist Cloud