为什么在我的后续脚本中,$ _SERVER supper全局数组中没有AUTH_TYPE的索引?
<?php
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="hi please enter your password and username"');
header('HTTP/1.1 401 Unauthorized'); // this will show the log in box
echo 'Text to send if user hits Cancel button'; // this will show if the user click cancel
exit;
} else {
echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>";
echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</p>";
echo "<p> {$_SERVER['AUTH_TYPE']} your authentication type.</p>";
var_dump($_SERVER) ;
}
?>