Results 1 to 1 of 1

Thread: Password protect a site

  1. #1
    Join Date
    Jan 2015
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Wink Password protect a site

    I am trying to very simply password protect a site. It does not have to be Fort Knox and I am using the below code. The problem is I want to use both capital and lower case letters. How do I make this possible?
    Code:
    <SCRIPT>
    function passWord() {
    var testV = 1;
    var pass1 = prompt('Please Enter Your Password',' ');
    while (testV < 3) {
    if (!pass1)
    history.go(-1);
    if (pass1.toLowerCase() == "letmein") {
    alert('You Got it Right!');
    window.open('protectpage.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>
    Last edited by Beverleyh; 01-20-2015 at 12:44 PM. Reason: formatting

Similar Threads

  1. Password protect 1 page
    By Chef in forum Looking for such a script or service
    Replies: 2
    Last Post: 09-11-2007, 01:59 PM
  2. Password Protect a Page Script Help
    By isamarlow in forum JavaScript
    Replies: 24
    Last Post: 03-01-2007, 06:00 PM
  3. password protect page
    By gell in forum Looking for such a script or service
    Replies: 2
    Last Post: 12-07-2006, 11:33 AM
  4. PHP password protect, LOTS of pages...
    By alexjewell in forum PHP
    Replies: 6
    Last Post: 08-09-2006, 12:08 AM
  5. Replies: 0
    Last Post: 08-17-2005, 01:51 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •