Results 1 to 7 of 7

Thread: Password script problem!

  1. #1
    Join Date
    Mar 2005
    Location
    Mumbai,INDIA
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Password script problem!

    I am getting the problem saying "http" is not a registered protocol
    while using th following script:
    http://www.dynamicdrive.com/dynamicindex9/password.htm
    what should i do to use it on the net.
    Thanks

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,070
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    Are you using PHP or ASP?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Mar 2005
    Location
    Mumbai,INDIA
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post

    No,
    What i want to say is that, i want to password protect my page(trying as example)
    http://www.angelfire.com/empire2/fun.../thankyou.html
    (window.location=password+"http://angelfire.com/empire2/funnyland/thankyou.html")
    the script is at another site.
    and the password is 'silas' but as i enter the password, there is a prompt saying:
    'silashhtp' no a registered protocol .
    I think that, the script is not meant for entering full url.And will only work wth
    *.html.
    And the password should be as such that it should be a name of my destination page(thankyou.html) in this case my password should be thankyou.
    Is it Right ?

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,070
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    Very close, try this if you are still having trouble:
    Code:
    window.location="http://angelfire.com/empire2/funnyland/"+password+"thankyou.html"
    and then the name of the page should be (using the password in your post):

    silasthankyou.html
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Mar 2005
    Location
    Mumbai,INDIA
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post

    I did as you said but all in vain.
    my script is at:
    http://www.angelfire.com/empire2/fun.../password.html
    password.html is the name of the file.
    I have renamed the file as silasthankyou.html.but now as i enter the password ,
    the browser takes me no where & drops me in to the same page after re-loading with the address:
    http://www.angelfire.com/empire2/fun...assword2=silas
    I even forgot to tell you that i had modified the script and removed the username option from the script
    the script looks like this :
    Code:
    <html>
    <body>
    <script>
    //Encrypted Password script- By Rob Heslop
    //Script featured on Dynamic Drive 
    //Visit http://www.dynamicdrive.com 
    //http://www.dynamicdrive.com/dynamicindex9/password.htm
    function submitentry(){
    password = document.password1.password2.value.toLowerCase()
    //username = document.password1.username2.value.toLowerCase()
    passcode = 1
    //usercode = 1
    for(i = 0; i < password.length; i++) {
    passcode *= password.charCodeAt(i);
    }
    /*for(x = 0; x < username.length; x++) {
    usercode *= username.charCodeAt(x);
    }*/
    //CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
    if(passcode==14547235500)
    //CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
    {
    window.location="http://angelfire.com/empire2/funnyland/"+password+"thankyou.html"
    else{
    alert("Password is Incorrect")}
    }
    </script>
    
    <form name="password1">
    <strong>Enter password: </strong>
    <input type="password" name="password2" size="15">
    
    <input type="button" value="Submit" onClick="submitentry()">
    </form>
    </body>
    </html>
    Do also tell me whether the form name "password1" and the input name"password2" can create any problem.

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,070
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    Not sure what the problem was but, here is one solution:

    Code:
    <script>
    //Encrypted Password script- By Rob Heslop
    //Script featured on Dynamic Drive 
    //Visit http://www.dynamicdrive.com 
    
    function submitentry(){
    password = document.password1.password2.value.toLowerCase()
    username = document.password1.username2.value.toLowerCase()
    passcode = 1
    usercode = 1
    for(i = 0; i < password.length; i++) {
    passcode *= password.charCodeAt(i);
    }
    for(x = 0; x < username.length; x++) {
    usercode *= username.charCodeAt(x);
    }
    //CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
    if(usercode==134603040&&passcode==14547235500)
    //CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
    {
    window.location="http://angelfire.com/empire2/funnyland/"+password+"thankyou.html"
    }
    else{
    alert("Invalid Password!")}
    }
    </script>
    
    <form name="password1">
    <input type="hidden"  value="john" name="username2">
    <strong>Enter password: </strong>
    <input type="password" name="password2" size="15">
    <input type="button" value="Submit" onClick="submitentry()">
    </form>
    Works here.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Mar 2005
    Location
    Mumbai,INDIA
    Posts
    64
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Not working yet.
    By the way thanks for replying .I'll try somme other password scripts.
    THANKS

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
  •