How to Password Protect Your Webpage ?

Tags

  • Open Notepad.
  • Copy these commands and paste it on notepad.
  • Now save it using .HTML extension.

                                                        (Password=web)
                     
--------------------------------------------------------------------------------------------------------------------------------------------------
<SCRIPT>
function passWord() { 
var testV = 1;
var pass1 = prompt('Please Enter Your Password',' ');
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1.toLowerCase() == "web") {
alert('You Got it Right!');
window.open('web.html');
break;
}
testV+=1;
var pass1 =
prompt('Access Denied - Password Incorrect, Please Try Again.','Password');
}
if (pass1.toLowerCase()!="password" & testV ==3)
history.go(-1);
return " ";
}
</SCRIPT>
<FORM><br><br><br><br><br><br><br><br><br><br>
<center><input type="button" value="Please enter the Password" onClick="passWord()"></center>
</FORM>


EmoticonEmoticon