< Buzzing or vibrating the login form using jquery Posted On May 15, 2012 : 0 comments << >> Simple div slideshow using jquery Posted On May 9, 2012 : 0 comments << >> Copy mysql column in varchar to type date Posted On May 3, 2012 : 0 comments << >> Enter only numbers inside a input field of a form using javascript Posted On May 1, 2012 : 0 comments << >> Slide in and out animate div vertically using jquery Posted On April 25, 2012 : 1 comment << >> Tag cloud using php, mysql and ajax with filter Posted On April 24, 2012 : 0 comments << >> Change webpage font color or background color from the user side using javascript Posted On April 19, 2012 : 0 comments << >> A single link that cycles through several webpage background color using javascript Posted On April 17, 2012 : 0 comments << >> Simple webpage redirection using perl script Posted On April 10, 2012 : 0 comments << >> Get ipaddress using perl script Posted On April 4, 2012 : 0 comments << >>

Password protect pages using javascript

This Tutorial Has Been Viewed 4,752 Times.
VN:F [1.9.17_1161]
Rating: 7.8/10 (4 votes cast)

Hello guys here is a simple code on how to password protect a webpage usingĀ  javascript.This is not a good idea coz it is not at all secure.But simply just like that a webpage which is protected using simple javascript is fun. :)

<script type=“text/javascript”>
function passWord() {
var testV = 1;
var pass1 = prompt(‘Please Enter Your Password’,’ ‘);
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1.toLowerCase() == “iamlost”) {
alert(‘You Got it Right!’);
window.open(‘theotherpage.html’);
break;
}
testV+=1;
var pass1 =
prompt(‘Access Denied – Password Incorrect, Please Try Again.’,'Give Me The Password’);
}
if (pass1.toLowerCase()!=”password” & testV ==3)
history.go(-1);
return ” “;
}
</SCRIPT>
<CENTER>
<FORM>
<input type=”button” value=”Enter Protected Area” onClick=”passWord()”>
</FORM>
</CENTER>

In the next version of this tutorial i can tell you guys how we can hide a div element and get the password from it do visit me often guys.

VN:F [1.9.17_1161]
Rating: 7.8/10 (4 votes cast)

Password protect pages using javascript, 7.8 out of 10 based on 4 ratings

Incoming search terms:

Leave a Reply

Proudly designed by Mistonline.in.
Affordable Seo PackagesSeo BlogEdu Backlinks