Results 1 to 3 of 3

Thread: Authentication - can't see why it does not work

  1. #1

    Thread Starter
    Registered User Olly's Avatar
    Join Date
    Apr 2001
    Location
    Switzerland
    Posts
    252

    Authentication - can't see why it does not work

    I got a naughty problem here. I have a password dialog script which should be working and looks very good. But even if I type the correct user/password it will not let me pass .
    PHP Code:
    <?php include ("./pass.php"); ?>
    <?php
    $User  
    "more";
    $Pswd  "beer";
    $Info "got trouble? mail [email][email protected][/email]";
        if ((
    $PHP_AUTH_USER!=$User)||($PHP_AUTH_PW!=$Pswd)) {
           
    Header('WWW-Authenticate: Basic realm="You need to authenticate"');
           
    Header('HTTP/1.0 401 Unauthorized');
           echo 
    "<html>
             <head>
             <title>Error - Access Denied</title>
             </head>
             <h1>Access denied</h1>
             <hr>
             <em>
    $Info</em>";
         exit;
        }
    ?>
    Do you have any idea why this is not working?
    I use <?php include ("./pass.php"); ?> to call it.
    Someone gave me the hint that the problem is that it is
    getting recalled all the time.... maybe that's the problem?
    Last edited by Olly; Nov 27th, 2002 at 05:14 PM.

  2. #2
    New Member
    Join Date
    Sep 2002
    Posts
    14
    Did u write something for case u pass?
    Like
    else{"U are logged!";}

    Sincerely,
    Sergey Booyny
    AlarIT programmer
    http://www.AlarIT.com
    Sincerely,
    Sergey Booyny
    AlarIT programmer
    http://www.AlarIT.com

  3. #3
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by serg4444
    Did u write something for case u pass?
    Like
    else{"U are logged!";}

    Sincerely,
    Sergey Booyny
    AlarIT programmer
    http://www.AlarIT.com
    1) That code you provided will cause an error. Give it a try.
    2) That would not matter. He would not get the error message if he logged in properly. He would simply get nothing. Not the error message.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

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



Click Here to Expand Forum to Full Width