Operating environment: Win2000 Server, Apache2, PHP4.3 installed in ISAPI module
PHP
IF (! isset ($ _ server ['php_auth_user'])) {
HEADER ('www-authenticate: Basic realm = "my realm");
HEADER ('http / 1.0 401 unauthorized');
// Error page
EXIT;
} else {
//Connect to the database
Echo "
hello {$ _server ['php_auth_user']}. p>
echo "
you entered {$ _server ['php_auth_pw']} as your password. p>";
/ / Compare the information entered by the user to the data in the database
IF (! isvalidate) {
// Jump to the error page
}
}
?>