PDA

View Full Version : How can I hide content before they input the pass?


youngScripter
10-25-2002, 01:19 AM
I have a page that when it loads, a prompt comes up asking for the password. But even before they put in the password, the content is shown. How can I hide it before they enter the password?

chrismiceli
10-25-2002, 02:03 AM
<script language="javascript">
function hello() {
test = prompt("what is the password", "put it here");
if (test=="thepassword") {
}
else
parent.location.href="http://www.google.com"
}
</script>
<body onLoad="hello()">

i think that should work.

smeagol
10-25-2002, 02:05 AM
Just a suggestion:

You could make a separate page that prompts for a password and forwards to the appropriate page after the password is entered.

Oops, a little too late. I was thinking the same as chrismiceli.

youngScripter
10-25-2002, 02:24 AM
thanks, never thought of that!