View Full Version : Password Prompt Problems


SarahBara
11-09-2003, 06:56 PM
I'm trying to use the javascript thing to give the visitors to my site access to a special page that they need a password to get into. I just have no idea how to use it...

neopetz.html: the page they are leaving
neopetsadoption.html: the page that is linked from the above one, and this is also the one that needs to be password protected...

What do I put in the code to get it to work?

<script language="JavaScript" type="text/javascript">
<!--hide
var password;
var pass1="mypassword";
password=prompt('What's the word again?',' ');
if (password==pass1)
alert('Clickie to see the shmeshy critters');
else
{
window.location="notsurewhatiputhere";
}
//-->
</script>

Any help would be greatly appreciated...

SoundRelic
11-11-2003, 04:24 AM
Hello Sarah I am very happy to tell you that I have discovered what that is, it is the website that the person is redirected to if they get the password wrong or if they press cancel thank you for posting that tidbit I realy need it.

SoundRelic
11-11-2003, 05:04 AM
this is what I have used ...

<script language="JavaScript" type="text/javascript">
<!--hide
var password;
var pass1="skoolsuck";
password=prompt('Please Enter Password',' ');
if (password==pass1)
alert('You Have Gotten The Password Correct Click OK.');
else
{
alert('You Have Gotten The Password Incorrect.');
window.location="http://www.rulestheweb.com/stoner420";
}
//-->
</script>