OK, I loaded PHP with the ISAPI filter, but still no luck with authentication..

Here's the basic script that works on Apache/Linux:
<?
// File name: admin_menu.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="The Back Care Center Admin Area"');
  header('HTTP/1.0 401 Unauthorized');
  echo 'Authorization Required!';
  exit;
 } else if (isset($PHP_AUTH_USER)) {
  if (($PHP_AUTH_USER !="test") || ($PHP_AUTH_PW !="123")) {
   header('WWW-Authenticate: Basic realm="The Back Care Center Admin Area"');
   header('HTTP/1.0 401 Unauthorized');
   echo 'Authorization Required!';
   exit;
  } else {
   // Start echo statement
   echo "hello";
}
}
?>

Reply via email to