hi, guys!
this is my first post on one of the phpbuilder.com's forums, but the problem i have has no solution at this time and i thought maybe you'll be able to help me.
it's about the http authentication. the authentication simply loops and no $PHP_AUTH_USER is passed.
i cannot use the Apache .htaccess solution because i need to authenticate users stored in a mysql database table.
here's a just a sample code that loops the authentication continously (my choice is a simple code that does not require the mysql part, but illustrates my problem).
<?
function autentif()
{
Header("WWW-Authenticate: Basic realm=\"Auth Name\"");
Header("HTTP/1.0 401 Unauthorised");
echo("you are not authorised to read this page");
exit;
}
if(!isset($PHP_AUTH_USER))
{
autentif();
}
else
{
print "user: $PHP_AUTH_USER<BR>pass: $PHP_AUTH_PW";
}
?>
thanks alot!