Site entrance help

Discussion in 'Web Design & Coding' started by jolly_roger, Dec 15, 2003.

  1. jolly_roger

    jolly_roger Buccaneer

    Joined:
    Aug 15, 2003
    Messages:
    11
    Likes Received:
    0
    Location:
    New Jersey
    Site

    i'm trying to edit my website so that the user has to answer a question correctly to enter my site, any help on html would help.
     
    jolly_roger, Dec 15, 2003
    #1
    1. Advertisements

  2. jolly_roger

    Nickweb Resident Filmaker Moderator

    Joined:
    Nov 7, 2003
    Messages:
    2,532
    Likes Received:
    27
    Location:
    North Wales, Britain
    try using this:
    the password is 'password'
    HTML:
     <!-- THREE STEPS TO INSTALL THREE TRIES:
     
        1.  Put the first code into the HEAD of your HTML document
        2.  Change protectedpage.html to your protected page
        3.  Add the final code to the BODY of your HTML document  -->
     
     <!-- STEP ONE: Copy this code into the BODY of your HTML document  -->
     
     <HEAD>
     
     <SCRIPT LANGUAGE="JavaScript">
     
     
     
     <!-- Begin
     function password() {
     var testV = 1;
     var pass1 = prompt('replace this with your question','');
     while (testV < 3) {
     if (!pass1) 
     history.go(-1);
     if (pass1 == "password") {
     alert('You Got it Right!');
     
     <!-- STEP TWO: Change protectedpage.html to your protected page  -->
     
     //  Change the following URL to your protected filename
     
     window.open('protectedpage.html');
     break;
     } 
     testV+=1;
     var pass1 = 
     prompt('Access Denied - Password Incorrect, Please Try Again.','Password');
     }
     if (pass1!="password" & testV ==3)               
     history.go(-1);
     return " ";
     }
     // End -->
     </SCRIPT>
     </head>
     
     <!-- STEP THREE: Copy the last code into the BODY of your HTML document  -->
        
     <BODY>
     
     <CENTER>
     <FORM>
     <input type="button" value="Enter Password Protected Area" onClick="password()">
     </FORM>
     </CENTER>
     
    Nickweb, Jan 7, 2004
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.