Web Analytics Made Easy -
StatCounter password prompt problem - CodingForum

Announcement

Collapse
No announcement yet.

password prompt problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • password prompt problem

    so the prompt appears when i enter my page, and i type the wrong password in. it takes me to a page that says "This page cannot be displayed." i'm using the code below. My request is, how do you make it go to a custom page "ALL" the time when the entered password is wrong?

    i understand why it works if i enter the correct password, but if i enter a wrong password, then it wont work because it requires an HTML document in the directory that has to have the name of the typed password to be able to go to that page.

    but there are millions of possibilities of passwords, and i do not have a million HTML documents with different password combinations.

    Code:
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    var password = 'abcdefgh'
    password=prompt('Please enter the password:','');
    if (password != null) {
    location.href= password + ".html";
    }
    // End -->
    </SCRIPT>
    Last edited by expo-recon; Aug 1, 2005, 03:12 AM.

  • #2
    You cannot test for the valid password in the script without revealing it, should someone view the source. You could if you encrypted it but, encryption that browsers can decrypt, people can too.
    - John

    Comment

    Working...
    X