Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: using php authentication box
09-05-2005, 09:42 PM #1
- Join Date
- Mar 2004
- Thanked 0 Times in 0 Posts
using php authentication box
header( 'WWW-Authenticate: Basic realm="Private"' );
header( 'HTTP/1.0 401 Unauthorized' );
echo 'Authorization Required.';
seems not to set the $PHP_AUTH_USER and $PHP_AUTH_PW globals why can that be?
09-06-2005, 12:26 AM #2
$_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW']
as your server may not have registered the global variables... I have however in some cases had problems using this on certain server setups, so I generally try (where possible) to use my own login system using HTML forms (that way I know theres not going to be any problems.
Some useful information: http://www.php.net/manual/en/features.http-auth.php