PHP Authentication
| From: | jmt2que001 at sneakemail dot com | Date: | Thu, 21 Feb 2002 10:28:29 +0000 |
| Subject: | PHP Authentication | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-12190@lists.php.net to get a copy of this message | ||
We just switched servers from Unix to Windows NT and all our authentication stopped working. It
brings up an internal server error. We installed the newest PHP and the newest Apache software.
Pretty much everything else works, except the authentication won't work. I've tried many
different versions of the code. Here is the last version that I tried. Any ideas on what might be
causing this
server error?
<?php
if (!isset($PHP_AUTH_USER)){
header( 'WWW-Authenticate: Basic realm="Private"' );
header( 'HTTP/1.0 401 Unauthorized' );
echo 'Authorization Required.';
exit;
} else {
echo 'Success!';
}
?>