Saved Bookmarks
| 1. |
Solve : Whats wrong with this Script?? |
||||||||
|
Answer» It keeps saying invalid LOGIN even when i enter the correct info.
QUOTE from: Bannana97 on January 19, 2009, 02:41:31 PM <script link="http://www.herbertsworld.com/scriptholder.html" > You are MISSING a type attribute and "link" should be "src". It should be: <script src="http://www.herbertsworld.com/scriptholder.html"> </script> I'm not SURE if that will work as it is a HTML file...No that isnt the problem, It works for all my other pages. The login keeps saying Login Incorrect even with the correct info.I'd say the problem is that your running the 'if (done==0) { alert("Invalid login!"); }' script on the same level as 'var done=0;' so it's immediately activating. I'm not good with JAVASCRIPT, but a tabbed Code: [Select]else if () command might work.Quote from: EchoLdrWolf316 on January 19, 2009, 07:51:21 PM I'd say the problem is that your running the 'if (done==0) { alert("Invalid login!"); }' script on the same level as 'var done=0;' so it's immediately activating. I'm not good with javascript, but a tabbed Code: [Select]else if () command might work. Yes, this could be the problem. <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function Login(){ var done=0; var username=document.login.username.value; username=username.toLowerCase(); var password=document.login.password.value; password=password.toLowerCase(); if (username=="Bannana97" && password=="se5asokn1") { window.location="userbailey451497529.html"; done=1; } elseif (username=="micky" && password=="bailey") { window.location="usermicky00000191.html"; done=1; } elseif (username=="apple202" && password=="passlolword") { window.location="userapple202ifsdhgio.html"; done=1; } else { done==0; alert("Invalid login!"); } } // End --> </SCRIPT> You might also have a problem with the username and password variables. To me, you are defining the same variables twice. var username=document.login.username.value; username=username.toLowerCase(); var password=document.login.password.value; password=password.toLowerCase(); Might be something like this: var user=document.login.username.value; username=user.toLowerCase(); var pass=document.login.password.value; password=pass.toLowerCase();Quote from: Bannana97 on January 19, 2009, 03:37:23 PM No that isnt the problem, It works for all my other pages. yeah, it's not a problem that your using attributes that don't exist. |
|||||||||