Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2003
    Location
    Sweden
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy How can i make two diffrend login and password

    I cant make two diffrend Login and password I need 5 or 3 bat it only login to one of them and i dont know how to let it login to 3diffrend passwords and logins plz mail me or something

  • #2
    New Coder
    Join Date
    Feb 2003
    Location
    ROMANIA
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool TRY this way...

    FIRST, I wouldn't use JS for password & login stuff (anyone clever enough to go to "View - > Source" will see the passwords), but anyway...

    Suppose you have this script:

    Code:
    <html>
    <head>
    
    
    <script language="JavaScript">
    <!--
    
    var passes = new Array();
    var done = false;
    
    //passwords below;
    
     passes[0] = 'white';
     passes[1] = 'blue';
     passes[2] = 'red';
     passes[3] = 'green';
     passes[4] = 'black';
    
    //got it? you can add as many passwords as you like; for now
    //you have 5.
    
    function logMEin()
    {
        if (done)
        {
             for (i=0; i<passes.length; i++)
             {
                if (document.login.login_field.value == passes[i])
                {
                 window.location = "index.html";
                 break;
                }
                else 
                {
                 if (i == (passes.length-1)) 
                   {
                    alert('The password you typed is wrong!\nTry again!')
                    document.login.login_field.select();
                   }
                }
            }
       }
    }
    
    //-->
    </script>
    
    </head>
    
    <body onload="done=true">
    
    <form name="login">
    <center>
    <input name="login_field" type="text" size="30" maxlength="25" value="">
    <br>
    <input name="go" type="button" value="login" onclick="logMEin()">
    <p>
    If you have a password, enter it in the field above and press
    the <b>login</b> button; <br>
    </p>
    <!-- by the way,  that's for dummies -->
    </center>
    </form>
    
    </body>
    
    </html>
    For your amusement, put a file called "index.html" in the same folder. Just to see that it works. Again, I SEE NO WAY to actually
    use this without PHP, ASP or something.

    JS login is just dust in the eyes, as a romanian expression says.
    Claudiu Iacob - Romania

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    Spain
    Posts
    420
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Don't resist to assimilation. Billions of Borgs can't be wrong!


  •  

    Posting Permissions

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