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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with login script

    Could somebody please help get this login script working(I know it's vulnerable):
    Code:
    <html>
    <body>
    <script type = "text/javascript">
    function validate() {
    var F_F_F2318797AS$ = document.GENERATOR.color.value;
    var color = "#FFFF9B"
    if (F_F_F2318797AS$ == color && 1==1 && 2==2) {
    alert ("Login was successful");
    return false;
    }
    else{
    alert ("Incorrect password");
    return false;
    }
    </script>
    <h1> Welcome to the realm of <big style="color:red">confusing</big> Javascript <h1>
    <form name = "GENERATOR">
    ENTER PASSWORD <input type="password" name="color">
    <input type="button" value="Submit" name="Submit" onclick= "validate()">
    <
    </form>
    </body>
    </html>
    Thanks in advance!

  • #2
    Regular Coder Nile's Avatar
    Join Date
    Jun 2008
    Posts
    280
    Thanks
    2
    Thanked 46 Times in 46 Posts
    You aren't closing your function (I also cleaned up a lil)
    Code:
    <html>
    <body>
    <script type = "text/javascript">
    function validate() {
        var F_F_F2318797AS$ = document.GENERATOR.color.value;
        var color = "#FFFF9B"
        if (F_F_F2318797AS$ == color && 1 == 1 && 2 == 2) {
            alert("Login was successful");
            return false;
        } else {
            alert("Incorrect password");
            return false;
        }
    }
    </script>
    <h1> Welcome to the realm of <big style="color:red">confusing</big> Javascript <h1>
    <form name = "GENERATOR" onsubmit="return validate();">
    ENTER PASSWORD <input type="password" name="color">
    <input type="button" value="Submit" name="Submit" onclick= "validate()">
    </form>
    </body>
    </html>

  • #3
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Wow
    /facepalm
    Thanks!

  • #4
    Regular Coder Nile's Avatar
    Join Date
    Jun 2008
    Posts
    280
    Thanks
    2
    Thanked 46 Times in 46 Posts
    No problem!


  •  

    Posting Permissions

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