Hi,
I'm trying to find out how php works by trying some tutorials. But this script below won't work!
<?php
echo $_SERVER["PHP_AUTH_USER"];
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!';
}
?>
When trying this script the login box that pops up does so 3 times (with
the correct password and username) before it echos the 'Authorisation Required' statement - not the 'Success!' statement.... whats going on?
I'm using OHTTPd (version 2.09) with
PHP 4.0.4pl1 (says phpinfo() ) on win ME.
I have the idea that this is very important! :-)
THX Freek