Hi!
if(!isset($PHP_AUTH_USER))
{
$COMPANY_NAME = "SourceTech AB";
header("WWW-Authenticate: Basic realm=\"The Realm of $COMPANY_NAME\"");
header("HTTP/1.0 401 Unauthorized");
echo "<H3>Error bla bla try again</H3>\n";
exit;
}
The snippet above returns "INTERNAL SERVER ERROR" from Apache.
The error log states:
"malformed header from script. Bad header=HTTP/1.0 401 Unauthorized: c:/drivers/php/php.exe"
I run everything on a windows machine,
PHP4.0.4pl1, Apache 1.3.19.
The strange thing is that I copied the code from another server of mine, a Linux with the same PHP version...
Any ideas anyone?