Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7

Thread: Login Password

  1. #1
    New to the CF scene
    Join Date
    Jan 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Login Password

    CODE BELOW:

    INDEX PAGE:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <html>
    <head>
    <title>Untitled</title>
    <SCRIPT LANGUAGE="JavaScript">
    
    <!-- Based on FTP log in by: Reinout Verkerk -->
    <!-- Original: Gordon Hudson (sales@hostroute.com) -->
    <!-- Web Site: http://www.hostroute.com/ -->
    <!-- This script and many more are available free online at -->
    <!-- The JavaScript Source!! http://javascript.internet.com -->
    
    <!-- Begin
    function Login(form) {
    var username = form.username.value;
    var password = form.password.value;
    var server = form.server.value;
    if (username && password && server) {
    var htsite = "http://" + username + ":" + password + "@" + server;
    window.location = htsite;
    }
    else {
    alert("Please enter your username and password.");
    }
    }
    // End -->
    </script>
    </head>
    
    <body>
    
    <form name=login>
    <input type="hidden" name="server" value="www.yahoo.com/">
    Username:
    <input type=text name=username size=20>
    <br><br>
    Password:
    <input type=password name=password size=20>
    <input type=button value="Login!" onClick="Login(this.form)" name="button">
    </form>
    
    <p><center>
    <font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
    by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
    </center><p>
    
    <!-- Script Size: 1.58 KB -->
    
    </body>
    </html>
    HTACCESS PAGE:
    Code:
    AuthName "Restricted Area" 
    AuthType Basic 
    AuthUserFile /temp/.htpasswd 
    AuthGroupFile /dev/null 
    require valid-user
    ERROR:
    Evertime I enter the correct UserName and Password I get this Error:



    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; Media Center PC 6.0)
    Timestamp: Sun, 16 Jan 2011 01:42:45 UTC


    Message: A security problem occurred.

    Line: 21
    Char: 1
    Code: 0
    URI: file:///C:/test/htmllogin/login.htm
    Last edited by Inigoesdr; 01-17-2011 at 09:17 PM.

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Are you sure your paths are correct? You seem to be using a windows server, but your AuthUserFile and AuthGroupFile paths are using *nix-style paths.

  • #3
    New to the CF scene
    Join Date
    Jan 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am using Windows...can you tell me the correct syntax?
    I just noticed I dont have a AuthGroup directory..could that be the problem?
    Last edited by mayrken; 01-19-2011 at 12:39 PM.

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    The authuser is the bigger problem. That authgroup can be removed since its pulling from /dev/null. On Windows, there is no such thing as /temp/.password, the closest *may* be C:\Temp\.password if thats what you named it when you generated it from apache. Shouldn't be in temp though.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #5
    New to the CF scene
    Join Date
    Jan 2011
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I forgot to mention I have tried c:\temp\.password and still getting the same error. I was tring this all out as a test before I intergrated this into my website.

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Where did you save the password file to when you ran the htpasswd program? That will be where you want to point the authuserfile to.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #7
    New to the CF scene
    Join Date
    Jan 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah looks like a path issue or I usually called it a landing page. Have you tried placing your correct credentials as default parameters?
    That is usually my main step in troubleshooting issues like this. And also check the format of the username and password field.
    Make sure to make it as a string field so it will recognize the characters your typed in correctly. Let me know if that resolves your issue.
    Last edited by vinyl-junkie; 01-22-2011 at 07:07 PM. Reason: signatures only allowed through the control panel


  •  

    Posting Permissions

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