Try this:

<? 
function authUser($username,$password,$realm,$message) {
        if (isset($GLOBALS["PHP_AUTH_USER"]) && (($GLOBALS["PHP_AUTH_USER"]
!= $username) || ($GLOBALS["PHP_AUTH_PW"] != $password))) { 
           header("WWW-Authenticate: Basic realm=\"$realm\""); 
           header("HTTP/1.0 401 Unauthorized"); 
           echo $message; 
           exit; 
        } elseif (!isset($GLOBALS["PHP_AUTH_USER"])) { 
                header("WWW-Authenticate: Basic realm=\"$realm\""); 
           header("HTTP/1.0 401 Unauthorized"); 
           echo $message; 
          exit; 
        }
        return true;
}

authUser("test","test","mine","You are not permited to access this
area!<BR><BR>try:<BR>password : test<BR>username : test");

$title = "Password";

echo "OK, you can look at this page!";

?>










-----Original Message-----
From: Bruno Freire [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 23, 2001 10:45 AM
To: '[EMAIL PROTECTED]'
Subject: [PHP] HELP!!! $PHP_AUTH_USER!!!!!!


Look....

I justs wanna make that password box show up in the screen....

But without a protected directory...

Thanks


Bruno

Reply via email to