php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11498 HTTP Authentication via PHP using documented code does not work
Submitted: 2001-06-15 04:08 UTC Modified: 2001-06-15 10:01 UTC
From: nateh999 at yahoo dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 4.0.5 OS: Windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
38 - 32 = ?
Subscribe to this entry?

 
 [2001-06-15 04:08 UTC] nateh999 at yahoo dot com
Hi, trying to do simple HTTP authentication (just to get it working, as the original mySQL connected version did not work -- same "symptoms") with this php code:

<?php
  if(!isset($PHP_AUTH_USER)) {
    Header("WWW-Authenticate: Basic realm=\"My Realm\"");
    Header("Status: 401 Unauthorized");
    echo "Text to send if user hits Cancel button\n";
    exit;
  } else {
    echo "Hello $PHP_AUTH_USER.<P>";
    echo "You entered $PHP_AUTH_PW as your password.<P>";
  }
?>
   
this is in a standalone file, login.php

it brings up the login prompt, but seems unable to get past that -- entering a login does nothing.  The popup shows 3 times, then it redirects to a page displaying the results of the "echo "Text to send if user hits Cancel Button\n";" line.

Not sure if i'm doing something wrong (doubt it, i copied this code from php.net after trying to write my own (which got the same results)) or if this is a bug....it may well be a bug with apache, but perhaps y'all know something about this....

Software setup info:

SERVER_SOFTWARE => Apache/1.3.20 (Win32)
SERVER_PROTOCOL => HTTP/1.1
HTTP_USER_AGENT => Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
PHP Version: 4.0.5

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-15 10:01 UTC] sniper@php.net
works for me just fine, you're doing something wrong.
this is wrong place to ask support questions. Try some public forum.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 23:01:27 2024 UTC