here is a simple authentication that by theory should work. Whenever I try to access the page i get the response internal server error. Im running an apache server and I am getting the error 'malformed header from script. Bad header=HTTP/1.1 401 Unauthorized: f:/websites/php/php.exe' If you have any advice that would be great. thanks...heres the code:
<?php
if ((!isset( $PHP_AUTH_USER )) || (!isset($PHP_AUTH_PW))) {
header( 'WWW-Authenticate: Basic realm="Private"' );
header( 'HTTP/1.1 401 Unauthorized' );
echo 'Authorization Required.';
exit;
} else {
echo "You entered $PHP_AUTH_USER for a username.<BR>";
echo "You entered $PHP_AUTH_PW for a password.<BR>";
}
?>