Results 1 to 3 of 3

Thread: Can someone Please Edit this Script

  1. #1
    Join Date
    Feb 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Can someone Please Edit this Script

    My Client does not want the user name or location fields on his login page. However, when I delete the user name and location fields, the script does not work. Can Someone help?

    This is the Dynamic Drive Password Script.
    Thank you,
    DMW

    <html>

    <head>
    <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Password</title>
    </head>

    <body topmargin="0">
    <p>
    <img border="0" src="../../online_catalogs/images/HD_banner.jpg" width="756" height="144"></p>
    <p><b><font face="Arial" size="2" color="#9B3E00">Please Sign In</font></b></p>
    <TD>
    <script>
    //Encrypted Password script- By Rob Heslop
    //Script featured on Dynamic Drive
    //Visit http://www.dynamicdrive.com

    function submitentry(){
    password = document.password1.password2.value
    username = document.password1.username2.value
    passcode = 1
    for(i = 0; i < password.length; i++) {
    passcode *= password.charCodeAt(i);
    }
    //CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
    if(passcode==985732098762)
    //CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
    {
    window.location=password+".htm"}
    else{
    alert("password wrong")}
    }
    </script>

    <form name="password1">
    <p>
    <strong><font face="Arial" size="2">Name:</font> </strong>
    <input type="text" name="username2" size="30"> <font face="Arial" size="2"><b>
    <br>
    <br>
    Location</b>:</font> <select size="1" name="D1">
    <option>Carson City, NV</option>
    <option>Chicago, IL</option>
    <option>Oxford, U.K.</option>
    <option>Plano, TX</option>
    </select><br>
    <br>
    <strong><font face="Arial" size="2">Enter password:</font> </strong>
    <input type="password" name="password2" size="15">

    <input type="button" value="Submit" onClick="submitentry()"><b><font face="Arial" size="2"><br>
    </font><font face="Arial" size="1" color="#C85827">Password is Case Sensitive
    </font></b> </p>
    </form></TD>
    </body>

    </html>

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    This script is deprecated; use the one at http://www.twey.co.uk/?q=encpass instead.

    The solution to your problem is to hide the username field:
    Code:
    <input type="text" name="username2" size="30" style="display: none;">
    Your code is very invalid. Run it through the validator and make it validate as HTML 4.01 Strict. Also stop abusing the <br> tag: if you want space between elements, use margins.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    And you might want to avoid FrontPage as well.
    Code:
    <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

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
  •