Hi, I've just installed Apache on my Win98 machine, but when I use headers in my PHP files, it freaks out! I get an 500 internal server error. Whatever that is. The error I get, is this one:
[Mon Jul 16 03:09:55 2001] [error] [client 217.157.105.10] malformed header from script. Bad header=HTTP/1.1 401 Unauthorized: d:/programmer/apache group/apache/php/php.exe
The script I try to run, is this one:
include('include/db.php');
$sql_auth_string = "SELECT id FROM login WHERE "."user=\"$PHP_AUTH_USER\" AND PASS=\"$PHP_AUTH_PW\"";
$auth_identifier = "Members Section";
if(isset($PHP_AUTH_USER)) {
if(!mysql_num_rows(
mysql_query($sql_auth_string))) {
Header("WWW-Authenticate: Basic realm=\"$auth_identifier\"");
Header("HTTP/1.1 401 Unauthorized");
Die();
}
} else {
Header("WWW-Authenticate: Basic realm=\"$auth_identifier\"");
Header("HTTP/1.1 401 Unauthorized");
Die();
}
But the funny thing is, that it works on other servers, that are using Apache. The ONLY server it isn't working on, is mine. What can I do??? please help me!