Results 1 to 2 of 2

Thread: help with script please

  1. #1
    Join Date
    Oct 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default help with script please

    1) Script Title: Encrypted Password script

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

    3) Describe problem: hi, im using an encrypted password script, it works fine and forwards to urls on submit, however on 3 of the for user passcodes as well as forwarding to the url the alert box appears!. Secondly i want the results to open in a new window, any help will be appreciated, ive put the 4 passcodes below, the urls are tests and the script is below.

    passcodes;

    14623

    24862

    36712

    45213

    Code:
    <script>
    //Encrypted Password script- By Rob Heslop
    //Script featured on Dynamic Drive 
    //Visit http://www.dynamicdrive.com
    
    <script>
    //Encrypted Password script- By Rob Heslop
    //Script featured on Dynamic Drive 
    //Visit http://www.dynamicdrive.com
    
    
    <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()
    
    passcode = 1
    for(i = 0; i < password.length; i++) {
    passcode *= password.charCodeAt(i);
    }
    
    //CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
    if(passcode==350859600)
    //CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
    {
    window.location="http://www.hotmail.com"}
    
    //CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
    if(passcode==393120000)
    //CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
    {
    window.location="http://www.yahoo.com"}
    
    //CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
    if(passcode==371101500)
    //CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
    {
    window.location="http://www.ebay.co.uk"}
    
    //CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
    if(passcode==344362200)
    //CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
    {
    window.location="http://www.google.co.uk"}
    
    else{
    alert("wrong try again.")}
    }
    </script>
    
    <form name="password1">
    
    <input type="password" name="password2" size="15">
    
    <input type="button" value="Search" onClick="submitentry()">
    </form>
    Last edited by jscheuer1; 10-29-2011 at 04:22 PM. Reason: Format

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'm not sure if you know this or not, but this is not very secure. Anyone can look at the source code and see the links and navigate directly to them.


    However, to make the script work, get rid of the highlighted and change the red:

    Code:
    <script>
    //Encrypted Password script- By Rob Heslop
    //Script featured on Dynamic Drive 
    //Visit http://www.dynamicdrive.com
    
    <script>
    //Encrypted Password script- By Rob Heslop
    //Script featured on Dynamic Drive 
    //Visit http://www.dynamicdrive.com
    
    
    <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()
    
    passcode = 1
    for(i = 0; i < password.length; i++) {
    passcode *= password.charCodeAt(i);
    }
    
    //CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
    if(passcode==350859600)
    //CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
    {
    open("http://www.hotmail.com", "_new");}
    
    //CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
    else if(passcode==393120000)
    //CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
    {
    open("http://www.yahoo.com", "_new");}
    
    //CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
    else if(passcode==371101500)
    //CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
    {
    open("http://www.ebay.co.uk", "_new");}
    
    //CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
    else if(passcode==344362200)
    //CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
    {
    open("http://www.google.co.uk", "_new");}
    
    else{
    alert("wrong try again.")}
    }
    </script>
    
    <form name="password1">
    
    <input type="password" name="password2" size="15">
    
    <input type="button" value="Search" onClick="submitentry()">
    </form>
    - John
    ________________________

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

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
  •