Results 1 to 3 of 3

Thread: Password Else If

  1. #1
    Join Date
    Dec 2008
    Location
    Selby, North Yorkshire
    Posts
    90
    Thanks
    28
    Thanked 2 Times in 2 Posts

    Default Password Else If

    1) Script Title: Encrypted Password script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex9/password.htm

    3) Describe problem: I would like the option to open other website pages using this script and I thought a simple else if would do the job.
    Why doesn't this work?
    }
    //CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
    if(usercode==12211815000&&passcode==1825426317464164800)
    else if(usercode==12211815000&&passcode==1912822615180439800)
    //CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
    {window.location=password+".asp"}
    else{
    alert("You have entered the wrong information.")}
    }

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    You forgot to add the part that tells the script what to do if the condition is true (the part in red below).

    Code:
    //CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
    if(usercode==12211815000&&passcode==1825426317464164800) {
     window.location='something.asp';
    }
    else if(usercode==12211815000&&passcode==1912822615180439800)
    //CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
    {window.location=password+".asp"}
    else{
    alert("You have entered the wrong information.")}
    }
    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Dec 2008
    Location
    Selby, North Yorkshire
    Posts
    90
    Thanks
    28
    Thanked 2 Times in 2 Posts

    Default

    Sorry but I'm still getting an 'Error On page' message.

    Code:
    //CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
    if(usercode==12211815000&&passcode==1825426317464164800)
    {window.location=password+".asp"}
    //CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
    else if(usercode==12211815000&&passcode==1912822615180439800)
    //CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
    {window.location=password+".asp"}
    else{
    alert("You have entered the wrong information.")}
    }
    Last edited by Snookerman; 06-15-2009 at 06:34 AM.

Bookmarks

Posting Permissions

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