|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Submitted: 2001-04-10 20:59 UTC Modified: 2001-08-19 03:20 UTC
From: gary dot lante at unisa dot edu dot au Assigned:
Status: Not a bug Package: *Web Server problem
PHP Version: 4.0.4pl1 OS: Freebsd
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:
Solve the problem:
45 - 5 = ?
Subscribe to this entry?

 [2001-04-10 20:59 UTC] gary dot lante at unisa dot edu dot au
When connecting to a site through IE5+ the site automatically Authenticate as False. Will not send a Authenticate message up. Works fine under Netscape 4+

if (isset($PHP_AUTH_USER) && isset($PHP_AUTH_PW)) { 
  // Connect to database 
  $conn = pg_pconnect ("dbname=".$db.$login);
  // Select database on MySQL server 

  // Formulate the query 

  $sql = "SELECT * FROM ".$table2." WHERE 
  username = '$PHP_AUTH_USER' AND 
  password = '$PHP_AUTH_PW' AND valid = 'y'"; 

  // Execute the query and put results in $result 

  $result = pg_Exec ( $sql );
  // Get number of rows in $result. 

  $num = pg_numrows( $result ); 
  if ( $num != 0 ) { 
  // A matching row was found - the user is authenticated. 
     $auth = true; 
if ( ! $auth ) { 
    header('http/1.0 401 Unauthorized');
    header('WWW-Authentucate: Basic realm="Private"');
    echo 'Authorization Required.<br>'; 
    echo 'Please go to <a href=./index,php?pg=REGISTER>Registration</a> page to Get a logon, It is Free.';
    echo "<br><b>???????".$PHP_AUTH_USER."<br>???????".$PHP_AUTH_PW."</b>";
} else {  


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-19 03:20 UTC]
Please check the manual page for basic auth support.
There are some good comments on it.

This is not PHP bug.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Sep 29 11:01:24 2023 UTC