Results 1 to 7 of 7

Thread: Encrypted Password Script problem

  1. #1
    Join Date
    Nov 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Encrypted Password Script problem

    Referring to: http://www.dynamicdrive.com/dynamicindex9/password.htm

    I'm quite a newbie at all this. At any rate, I built a site for my local camera club and am using this script to protect member information. It worked fine when I first put the site up, but now (a month later), is no longer working. I don't believe I've changed anything, I've hardly touched the site until today, trying to figure out the problem. Any help would be appreciated. I really like this script when it works!

    Page I'm referring to: http://www.hollistercameraclub.com/passwordpage.htm

    Thanks!

    Toni

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

    Default

    Your problem is this:
    Code:
    <script type="text/javascript">
    @import url("password.js");
    </script>
    This is Javascript, not CSS.
    You want:
    Code:
    <script type="text/javascript" src="password.js"></script>
    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
    Nov 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I've tried it both ways. No difference. I changed the JS source reference today but it was working and then quit working with the usual method. The problem is elsewhere.

    And I've used this Javascript source reference on another site without problems.

    Toni

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

    Default

    Would you mind using the other method, for debugging purposes?
    And could you direct me to the other site where you've used this without problems?
    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!

  5. #5
    Join Date
    Nov 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well, I used the JS debugger tool in Opera and now the password script works in Firefox and Opera, but not in IE. Ugh! (And yes, Opera liked the regular JS script reference.)

    The other page where I've used the @import method is:
    http://www.ifwisheswerehorses.org/newversion.htm. Granted, this is a test page for a new layout and the page does have some issues, but as far as I can tell, they're not JS-related. The script is for the subscribe option and so far seems to work across Opera, Firefox and IE. (The recommend script is PHP-based and I'm having fits, but that's a different story.)

    The way I made the password JS work in Opera and Firefox was to remove the "password" in this bit of the code:
    {
    window.location="theprotectedpage.htm"}
    else{
    alert("Sorry! This isn't correct!")}
    }
    originally: {window.location=password+"theproctectedpage.htm....}

    But what's holding it up in IE? It was working perfectly there a month ago! Thanks for your time and help.

    Toni

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

    Default

    Firstly, all is not well on the other page where you've used this. Firefox, for one, throws an "illegal character" error and doesn't use the script.
    I don't have IE available to test this, unfortunately. Could you post the error(s) you get with this browser?
    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!

  7. #7
    Join Date
    Nov 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I'm using the latest version of Firefox (not in safemode) and have tested the e-mail script a number of times on all three browsers and it works fine on my computer. Haven't tested it yet from another computer.

    At any rate, IE doesn't give any specific error message with the password script. I've looked for a way to force it to give me the errors but I don't know how to do that in IE. All it says is "error on page". It doesn't even run the script because when I enter a wrong password, I don't even get my little "wrong password" pop-up box. At this point, I can only assume it's an IE/script incompatbility thing, but what?

    I also assume that if there's an problem in IE, there will be the same problem in Netscape since they seem to be simliar. Haven't tried it there yet since that's on a different computer. (Firefox and Opera both use the correct password and give the pop-up box when a wrong one is entered.)

    Here's the Javascript I'm using for the password (with password info removed):
    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);
    }
    if(usercode==555&&passcode==555)
    {
    window.location="protectedpage.htm"}
    else{
    alert("Sorry! This isn't correct!")}
    }

    Any thoughts?

    Toni

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
  •