alabama.blues
New member
Hi
I'm having a little problem on my website. I have two areas on my website that I want to be protected, so I have authentication set up on both,
if(!isset($_SERVER['PHP_AUTH_USER']))
{
Header("WWW-Authenticate: Basic realm=\"Admin Center\"");
Header("HTTP/1.0 401 Unauthorized");
exit();
}
else
{
etc... where it goes in the db and gets the user list. To the basic user area it would grant access to anyone who entered their login and password and it works fine. Now I want to set up admin are authentication using the same code, but only now it checks if the user has administrative rights set by a special key in the db. But the problem is, no matter what I do the browser would not ask to login and would not show anything. Tried several PCs, several browsers. Going directly to the admin area - nothing. Going to the user area - asks for login and grants access. Going to the admin area again - nothing.
Any ideas?
I'm having a little problem on my website. I have two areas on my website that I want to be protected, so I have authentication set up on both,
if(!isset($_SERVER['PHP_AUTH_USER']))
{
Header("WWW-Authenticate: Basic realm=\"Admin Center\"");
Header("HTTP/1.0 401 Unauthorized");
exit();
}
else
{
etc... where it goes in the db and gets the user list. To the basic user area it would grant access to anyone who entered their login and password and it works fine. Now I want to set up admin are authentication using the same code, but only now it checks if the user has administrative rights set by a special key in the db. But the problem is, no matter what I do the browser would not ask to login and would not show anything. Tried several PCs, several browsers. Going directly to the admin area - nothing. Going to the user area - asks for login and grants access. Going to the admin area again - nothing.
Any ideas?