I got the following script to password protect one page in my website. However, on the third try (or if you click "cancel", it takes you to the protected page anyway. I just want to take them to the home page if they don't have the password. This doesn't need to be particulaly secure, just an additional step to get to the page. Also, how do I get it to display "*" instead of the actual letters as you type in the password?
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function password() {
var testV = 1;
var pass1 = prompt('Please Enter Your Password','');
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1 == "password" {
break;
}
testV+=1;
var pass1 =
prompt('Access Denied - Password Incorrect, Please Try Again.','Password');
}
if (pass1!="password" & testV ==3)
history.go(-1);
return " ";
}
Thanks a lot! Calista :-X
Jedi Knight,
Champion of the Force
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function password() {
var testV = 1;
var pass1 = prompt('Please Enter Your Password','');
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1 == "password" {
break;
}
testV+=1;
var pass1 =
prompt('Access Denied - Password Incorrect, Please Try Again.','Password');
}
if (pass1!="password" & testV ==3)
history.go(-1);
return " ";
}
Thanks a lot! Calista :-X
Jedi Knight,
Champion of the Force