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
    May 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation PLEASE Help Me!!!

    Hello I want to create a login page so this is what I found to do:
    <html> <head> <title>Please type your Username and Password... </title> <script language="JavaScript" type="text/JavaScript" src="login.js"></script> </head> <body bgcolor="#eeeeee"> <form> <br> <center> Username: <input type="text" name="username" style="background:#bfbfbf;color:#212121;border-color:#212121;" onFocus="this.style.background = '#ffffff';" onBlur="this.style.background = '#bfbfbf';"> <br> Password: <input type="password" name="password" style="background:#bfbfbf;color:#212121;border-color:#212121;" onFocus="this.style.background = '#ffffff';" onBlur="this.style.background = '#bfbfbf';"> <br> <input type="button" value="Login" onClick="Login(this.form);" style="background:#bfbfbf;color:#000000;border-color:#212121;" onMouseOver="this.style.color = '#404040';" onMouseOut="this.style.color = '#000000';" onFocusr="this.style.color = '#404040';" onBlur="this.style.color = '#000000';"> </center> </form> </body> </html>
    You can change the appearance. External JavaScript code (login.js): <!-- Begin function Login(form) { username = new Array("u1","u2","u3","u4","u5","u6","u7","u8","u9","u10"); password = new Array("p1","p2","p3","p4","p5","p6","p7","p8","p9","p10"); page = "secretpage" + ".html"; if (form.username.value == username[0] && form.password.value == password[0] || form.username.value == username[1] && form.password.value == password[1] || form.username.value == username[2] && form.password.value == password[2] || form.username.value == username[3] && form.password.value == password[3] || form.username.value == username[4] && form.password.value == password[4] || form.username.value == username[5] && form.password.value == password[5] || form.username.value == username[6] && form.password.value == password[6] || form.username.value == username[7] && form.password.value == password[7] || form.username.value == username[8] && form.password.value == password[8] || form.username.value == username[9] && form.password.value == password[9]) { self.location.href = page; } else { alert("Either the username or password you entered is incorrect.\nPlease try again."); form.username.focus(); } return true; } // End -->
    I created the loginpage.html and login.js. In the JavaScript page it says this:
    <!-- Begin function Login(form) { username = new Array("Admin","u2","u3","u4","u5","u6","u7","u8","u9","u10"); password = new Array("PASS","p2","p3","p4","p5","p6","p7","p8","p9","p10"); page = "login" + ".html"; if (form.username.value == username[0] && form.password.value == password[0] || form.username.value == username[1] && form.password.value == password[1] || form.username.value == username[2] && form.password.value == password[2] || form.username.value == username[3] && form.password.value == password[3] || form.username.value == username[4] && form.password.value == password[4] || form.username.value == username[5] && form.password.value == password[5] || form.username.value == username[6] && form.password.value == password[6] || form.username.value == username[7] && form.password.value == password[7] || form.username.value == username[8] && form.password.value == password[8] || form.username.value == username[9] && form.password.value == password[9]) { self.location.href = page; } else { alert("Either the username or password you entered is incorrect.\nPlease try again."); form.username.focus(); } return true; } // End -->
    It says something when you type in a wrong password or username. How do I make it go to a certain page when you type in everything correctly?
    Last edited by halofreak345; 05-25-2005 at 10:43 PM.

  • #2
    New to the CF scene
    Join Date
    May 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Does anyone know? Anyone at all?

  • #3
    New to the CF scene
    Join Date
    May 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not like anyone cares , but I fiugured it out own my own . If you want to know (doubtfull) it is the red:

    <!-- Begin function Login(form) { username = new Array("Admin","u2","u3","u4","u5","u6","u7","u8","u9","u10"); password = new Array("qqqqqq","p2","p3","p4","p5","p6","p7","p8","p9","p10"); page = "PAGE" + ".HTML"; if (form.username.value == username[0] && form.password.value == password[0] || form.username.value == username[1] && form.password.value == password[1] || form.username.value == username[2] && form.password.value == password[2] || form.username.value == username[3] && form.password.value == password[3] || form.username.value == username[4] && form.password.value == password[4] || form.username.value == username[5] && form.password.value == password[5] || form.username.value == username[6] && form.password.value == password[6] || form.username.value == username[7] && form.password.value == password[7] || form.username.value == username[8] && form.password.value == password[8] || form.username.value == username[9] && form.password.value == password[9]) { self.location.href = page; } else { alert("Either the username or password you entered is incorrect.\nPlease try again."); form.username.focus(); } return true; } // End -->

  • #4
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    Perhaps you know and don't care, but, you can view source to see all your user names and passwords. Your code will only prove usefull to the most novice of users. No arguing please.

    Have fun,

    Basscyst
    Last edited by Basscyst; 05-26-2005 at 12:33 AM.
    Helping to build a bigger box. - Adam Matthews


  •  

    Posting Permissions

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