Well...
I'm running module mode, and with a pretty standard php 4.1.2 setup in an apache server running on linux.
When I pass off to this script with a simple form, I still get the standard login screen pop up, which of course means that trying to populate
$PHP_AUTH_USER or $PHP_AUTH_PW with passed get vars is just not working..
$PHP_AUTH_USER = $user_name;
$PHP_AUTH_PW = $password;
if ((!isset($PHP_AUTH_USER)) || (!isset($PHP_AUTH_PW))) {
header( 'WWW-Authenticate: Basic realm="Private"' );
header( 'HTTP/1.0 401 Unauthorized' );
echo 'Not Authorized';
exit;
} else {
echo 'Authorized';
}
I also tried setting the vars and then write to a file owned by the root user.. I just get an Apache permission error.
I also tried making the form names pass the vals directly as in
<form action="auth_test2.php" method="POST">
<input type="text" name="PHP_AUTH_USER"><br>
<input type="text" name="PHP_AUTH_PW">
</form>
(I also tried the GET method)
Also no luck.. What gives.. this is VERY simple code here, not rocket science. What is the small point I'm just to stupid to get!
Paul the Pixel