Pages

Ads 468x60px

Sep 25, 2011

How To Put Password on a Post in Blogger

With the little help from this script, you can lock/hide some certain posts on your blogger so that only people with the password can view them. Therefore, someone without the password can't get access to that post.

To do that, copy and paste the following script to your post in HTML view.
<script type="text/javascript">
var password;
var pass1 = "PASSWORD";
password=prompt("Please enter the password to view this page:","");

if (password==pass1) {
  window.location= "LINK TO BE OPEN IF PASSWORD IS CORRECT";
} else {
  window.location= "LINK TO BE OPEN IF PASSWORD IS NOT CORRECT";
}
</script>


Explanation:
1. PASSWORD is the password needed to be typed to access the page.
2. LINK TO BE OPEN IF PASSWORD IS CORRECT is the link of the post you are using this password script on.
3. LINK TO BE OPEN IF PASSWORD IS NOT CORRECT is the page to be taken to if the password entry is incorrect. This can be your homepage or any other page you want.



Here's the example how you use the script:

Tutorial by basicxtutorial.

1 comments: