I can't figure out why this script won't work - I copied it straight from a tutorial page and it doesn't work. Even with the username and password hardcoded, it never authenticates?!?! It always kicks the 401 box no matter what I enter. Any ideas?
Thanks so much!
<?php
if ( ( !isset( $PHP_AUTH_USER )) || (!isset($PHP_AUTH_PW))
|| ( $PHP_AUTH_USER != 'user' ) || ( $PHP_AUTH_PW != 'open' ) ) {
header( 'WWW-Authenticate: Basic realm="Private"' );
header( 'HTTP/1.0 401 Unauthorized' );
echo 'Authorization Required.';
exit;
} else {
echo 'Success!';
}
?>