Files
lpmj6/13/01.php
T
RobinNixon 0335342e00 First Draft
First Draft of the Example Files
2020-12-10 13:21:38 +00:00

15 lines
412 B
PHP

<?php
if (isset($_SERVER['PHP_AUTH_USER']) &&
isset($_SERVER['PHP_AUTH_PW']))
{
echo "Welcome User: " . htmlspecialchars($_SERVER['PHP_AUTH_USER']) .
" Password: " . htmlspecialchars($_SERVER['PHP_AUTH_PW']);
}
else
{
header('WWW-Authenticate: Basic realm="Restricted Area"');
header('HTTP/1.0 401 Unauthorized');
die("Please enter your username and password");
}
?>