<?php
   // replace uuuu by your user name and pppp by your password
   $authorized = false;
   $user = $_SERVER['PHP_AUTH_USER'];
   $pass = $_SERVER['PHP_AUTH_PW'];
   if (isset($user) && isset($pass) && $user === "uuuu" && $pass === "pppp")
   {
      $authorized = true;
   }
   if ( ! $authorized )
   {
      header('WWW-Authenticate: Basic realm="Top Secret Files"');
      header('HTTP/1.0 401 Unauthorized');

?>
      <html>
      <head><title>Unauthorized</title></head>
      <body>
      <h1>You are not authorized to view this page</h1>
      </body>
      </html>

<?php     
      exit();
   }
?>
