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 6 of 6
  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    login and password window

    someone knows how to generate that small window that apears when you go into a member area of a secure place that ask you for a login and password, like window does.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    logins

    Its all to do with .htaccess and htpassword files.

    I am not 100% sure on the how's and when tos etc but I am sure someone can elaborate.
    Therapy is expensive, popping bubble wrap is cheap, you choose.

  • #3
    Regular Coder
    Join Date
    May 2003
    Location
    Manassas, VA, USA
    Posts
    220
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you use a password script, you would have to use javascript to have a password window pop up, then have the form in the pop up load send the information back to the main window and close itself.

    -Andrew

  • #4
    New Coder
    Join Date
    Jul 2003
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You may also try using ASP and there is a way (though I never have tried it) to get similar security and access as using Windows NT

  • #5
    New Coder
    Join Date
    Jul 2003
    Location
    Pittsburgh, PA
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can use HTTP headers to make that dialog come up:

    WWW-Authenticate: Basic realm="Place To Access"

    You can do it like this with PHP:

    PHP Code:
    // user/pass not given yet
    if(!isset $_SERVER['PHP_AUTH_USER'])
    {
        
    // if user submits info, page is re-requested with vars set,
        // if user hits cancel then code after first header() is displayed
        
    header('WWW-Authenticate: Basic realm="Place to access"');
        
    header('HTTP/1.0 401 Unauthorized');
        die(
    'You hit cancel button');
    }
    else    
    // user/pass submitted through dialog
    {
        echo 
    "You entered {$_SERVER['PHP_AUTH_USER']} as username.<br>";
        echo 
    "You entered {$_SERVER['PHP_AUTH_PW']} as password.<br>";

    Last edited by CrAzYCoDeR969; 08-06-2003 at 05:42 AM.

  • #6
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    You can do it with ASP/IIS too. You just change the permissions on the files or folders.
    OracleGuy


  •  

    Posting Permissions

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