Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with password script

Status
Not open for further replies.

calista

Programmer
Jan 24, 2001
545
US
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=&quot;JavaScript&quot;>
<!-- Begin
function password() {
var testV = 1;
var pass1 = prompt('Please Enter Your Password','');
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1 == &quot;password&quot;) {
break;
}
testV+=1;
var pass1 =
prompt('Access Denied - Password Incorrect, Please Try Again.','Password');
}
if (pass1!=&quot;password&quot; & testV ==3)
history.go(-1);
return &quot; &quot;;
}

Thanks a lot! Calista :-X
Jedi Knight,
Champion of the Force
 
Ok changed my mind dont look at it, just read it properly, its not as cleva as I thought
 
Whoops sorry, now i know where you got your source code :)
I going home, maybe I be awake 2morrow.
 
OK! Thanks for the attempt. ;-). The thing that really bugs me is that when you hit &quot;Cancel&quot; three times, it goes on into the protected page. I can probably figure out the rest, but that part really has me stumped. Calista :-X
Jedi Knight,
Champion of the Force
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top