Picarolio:
Yes, you can. The simplest way is to use a simple
javascript method. Though a more robust version entails
using ASP and authenticating against a database.
Something tells me you aren't keen on that route, so
here's the code (courtesy of javascriptkit.com) which you
should place between the <body> tags of your page:
<SCRIPT>
function passWord() {
var testV = 1;
var pass1 = prompt('Please Enter Your Password',' ');
while (testV < 3) {
if (!pass1)
history.go(-1);
if (pass1.toLowerCase() == "hey") {
alert('You Got it Right!');
window.open('Page1.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>
<CENTER>
<FORM>
<input type="button" value="Enter Protected Area"
onClick="passWord()">
</FORM>
</CENTER>
In the code above, the password is "hey" as mentioned in
line 8, so edit as you wish. Also, the line which
reads "window.open('Page1.html')" should be edited to
list the html page you wish visitors to reach if they've
correctly entered the password. That's it.
Enjoy,
Carmen