httpauth01.php to HTML

index

USE AT OWN RISK

Generated: Tue Jul 31 15:22:01 2007 from httpauth01.php 2006/03/06 406 bytes.

<?php
// first try httpauth01.php
 if (!isset($_SERVER['PHP_AUTH_USER'])) {
 header('WWW-Authenticate: Basic realm="My Realm"');
 header('HTTP/1.0 401 Unauthorized');
 echo 'Text to send if user hits Cancel button';
 exit;
 } else {
 echo "<p>Hello [<b>{$_SERVER['PHP_AUTH_USER']}</b>].</p>";
 echo "<p>You entered [<b>{$_SERVER['PHP_AUTH_PW']}</b>] as your password.</p>";
 }
?>
 

index

Valid HTML 4.01 Transitional