First Draft
First Draft of the Example Files
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
$username = 'admin';
|
||||
$password = 'letmein';
|
||||
|
||||
if (isset($_SERVER['PHP_AUTH_USER']) &&
|
||||
isset($_SERVER['PHP_AUTH_PW']))
|
||||
{
|
||||
if ($_SERVER['PHP_AUTH_USER'] === $username &&
|
||||
$_SERVER['PHP_AUTH_PW'] === $password)
|
||||
echo "You are now logged in";
|
||||
else die("Invalid username/password combination");
|
||||
}
|
||||
else
|
||||
{
|
||||
header('WWW-Authenticate: Basic realm="Restricted Area"');
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
die ("Please enter your username and password");
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user