Title: Password protected document : Protect your web page with specific password for Post by: Daniel Franklin on September 29, 2007, 10:33:32 AM <!-- Begin var function endar(){ var testV = 1; username=" "; password=" "; while (testV < 3) { username=prompt("Username:",""); password=prompt("Password:",""); if (username) { if (password) { if (username=="endar") { if (password=="seo") { window.location="index.htm";} else { alert ("Invalid password!") } } else if (username=="vienna") { if (password=="prettygirl") { window.location="antecedent.htm";} else { alert ("Invalid password!") } } else if (username=="smith") { if (password=="niceboy") { window.location="list.htm";} else { alert ("Invalid password!") } }else if (username=="tommy") { if (password=="bigguy") { window.location="text.htm";} else { alert ("Invalid password!") } }else { alert ("Invalid ID!") } } history.go(-1); break; } testV+=-1; }} // End --> </script> </head> <body> <input type=button value = "Login" style="font-size:10;width:150" onclick="endar()" > </body> </html> Articles Source - Free Articles |