...

View Full Version : using php authentication box



serap
09-05-2005, 10:42 PM
The following:

header( 'WWW-Authenticate: Basic realm="Private"' );
header( 'HTTP/1.0 401 Unauthorized' );
echo 'Authorization Required.';
exit;

seems not to set the $PHP_AUTH_USER and $PHP_AUTH_PW globals why can that be?

thanks

missing-score
09-06-2005, 01:26 AM
try using:

$_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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum