View Full Version : using php authentication box

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

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
try using:


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