Results 1 to 3 of 3

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

Threaded View

  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.

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