Login script not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Niyamsan Chhaya
    New Member
    • Sep 2006
    • 4

    Login script not working

    Can someone out there tell me why this script(I know-poorly written script) is not working?

    [HTML]<html>
    <head>
    <title>Password </title>

    <script language="javas cript">
    function checkPass()
    {
    var pBox=window.doc ument.input.log inname.value
    var lBox=window.doc ument.input.pas sworld.value

    if(lBox=="Chhay a" ||lBox=="chhaya " || lBox=="niyam" || lBox=="Niyam")
    {
    if(pBox== "Imemyself" || "yoyo" || "frienship" || "Niyam" || "niyam")
    {
    alert('Welcome' )
    window.location = "OnOff.htm"
    }
    }
    if(lBox=="" || pBox == "")
    {
    if(lBox=="" && pBox==""){alert ('please enter the user name and password')}
    if(pBox==""){al ert("We cannot let you enter without THE PASSWORD or THE LOGINNAME")}
    if(pBox=="niyam is the best"){alert(' Nice try')}
    }
    }
    </script>

    </head>

    <body bgcolor=#feffcc >

    <br />
    <br />

    <form name="input">
    <input type="text" name="loginname " value=""><font face="Lucida Handwriting" color=#444444 size=1>Login Name</font>
    <br />
    <input type="password" name="passworld " value=""><font face="Lucida Handwriting" color=#444444 size=1>Password </font>
    <br />
    <input type="button" name="Ok" value="All Right" onClick="checkP ass()">
    <input type="reset" name="NaNa" value="Reset"></input>
    </form>

    </body>
    </html>[/HTML]
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Perhaps pBox and lBox are wrong way round.

    In any case, a login script should be coded server-side.

    Comment

    Working...