Thursday, June 28, 2012

Password Lock For Certain Post

Learn how to adding blog
http://www.tweakmyblogger.com/p/blog-tweaks.html

Always Remember To Back Up Your Template Before Attempting Any Of The Tweaks On This Site


Password Lock For Certain Post

With this little script you can lock post of your choosing so only people who know the password can view them. Keep in mind this will not stop anyone who is good with computers. So don't go saving your bank ATM pin on a post and expect this to protect it.

Just paste this script in a post in Edit HTML mode.

<script type="text/javascript">
var password;
var pass1 = "PASSWORD";
password=prompt("Please enter your password to veiw 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>

Red is the password needed to be typed to access the page.
Green is the link of the post you are using this password script on.
Orange is the page to be taken to if the password entry is incorrect. This can be your homepage or a page of your choosing.


No comments:

Post a Comment