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 to the CF scene
    Join Date
    Feb 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with non secure login and redirect

    I'm trying to create and login and redirect on my home page for my clients. I am a designer not a coder, so I want something very simple (HTML, Jave Script). The scripts I have are close but I'm still not able to get a redirect. Thank you for any help.

    Here are the scripts

    HTML file

    Index.html

    <html>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=macintosh">
    <title>My Password Form</title>
    </head>
    <script language="JavaScript" type="text/JavaScript" src="login_password_info.js"></script>
    <body>

    <!-- BEGIN LOGIN FORM -->
    <form name="login" action="javascript:nextPage()" method="POST" onsubmit="check_login(this)">
    username: <input type="text" name="username" value=""><br>
    password: <input type="pasword" name="password" value=""><br>
    <input type="submit" value="SUBMIT" name="submit">
    </form>
    <!-- END LOGIN FORM -->

    </body>
    </html>


    Java Script file

    login_password_info.js

    // ------- PASSWORDS AND REDIRECTS ---------
    var login_array = [
    ["jon","athan","http://www.designiskinky.com"],
    ["cyn","thia","http://www.designinteract.com"],
    ["username","password","http://www.yahoo.com"]
    ];



    // ------- FUNCTIONS ---------
    function check_login (thisForm) {
    for (var i in login_array) {

    if (thisForm.username.value == "") {
    alert("Please enter your username.");
    thisForm.username.focus();
    return false;
    }

    if (thisForm.password.value == "") {
    alert("Please enter your password.");
    thisForm.username.focus();
    return false;
    }

    if ((login_array[i][0] == thisForm.username.value) && (login_array[i][1] == thisForm.password.value)) {
    // alert(login_array[i][2]);
    theURL = login_array[i][2]
    document.location.href = theURL;
    } else {
    alert("Your username and password do not match our records. Please try again.");
    return false;
    }
    }
    }

  • #2
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    What is the point of a non-secure log in. That's like having a key to your car, but everyone elses key works too if they wiggle it 3 times.

    This is a fairly secure login with javascript and has detailed info on it's usage:

    Secure Login with javascript

    Basscyst
    Helping to build a bigger box. - Adam Matthews

  • #3
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks

    That script is perfect and as far as the non-secure login. It's more for the ability to keep clients from looking at other clients projects. I don't think they’re going to hack my site to see what else I'm working on. But thanks a lot those scripts are perfect..


  •  

    Posting Permissions

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