Results 1 to 2 of 2

Thread: WWW-Authenticate [resolved]

Threaded View

  1. #1

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    WWW-Authenticate [resolved]

    i found this code on my computer, from ages ago, and i cant get it to work? Im running IIS and the variables arent being set?

    PHP Code:
    <?php
      
    if (empty($_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 {$_SERVER['PHP_AUTH_USER']}.</p>";
        echo 
    "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</p>";
      }
    ?>
    Thanks
    Last edited by john tindell; Apr 13th, 2004 at 01:22 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width