I am trying to use the global variable $PHP_AUTH_USER, all the examples I have found say that PHP must be installed as a module.
I do not know what that means or how to install PHP as a module.
http://hotwired.lycos.com/webmonkey/00/05/index2a_page2.html?tw=programming
Is the article I am following:
This is the script that will not run:
<?php
// File Name: auth01.php
// Check to see if $PHP_AUTH_USER already contains info
if (!isset($PHP_AUTH_USER)) {
// If empty, send header causing dialog box to appear
header('WWW-Authenticate: Basic realm="My Private Stuff"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;
}
// If not empty, display values for variables
else {
echo "
<P>You have entered this username: $PHP_AUTH_USER<br>
You have entered this password: $PHP_AUTH_PW<br>
The authorization type is: $PHP_AUTH_TYPE</p>
";
}
?>
😃