[BlueOnyx:02208] Re: $SERVER['PHP_AUTH_USER'] is empty

Charles Bowman charlesbowman at wknet.co.uk
Wed Aug 26 09:22:33 -05 2009


Check your version of PHP (this is a known fault in 5.0.0)

Try:
<?php
  if (!isset($_SERVER['PHP_AUTH_USER'])) {
   header('WWW-Authenticate: Basic realm="My Test 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>";
  }
?>

Try debugging the script above.

Cheers,
C

-----Original Message-----
From: blueonyx-bounces at blueonyx.it
[mailto:blueonyx-bounces at blueonyx.it]On Behalf Of DD
Sent: 26 August 2009 14:17
To: blueonyx at blueonyx.it
Subject: [BlueOnyx:02206] $SERVER['PHP_AUTH_USER'] is empty


Hi all,

I've been searching around for this but not found a difinitive answer.

In my PHP script I check the calue of $_SERVER['PHP_AUTH_USER'] to see what
the entered username was.  In PHP4 on BlueQuartz this was fine, but on our
new BX server the value is blank.

One suggestion is that they're only available if PHP is running as an Apache
module, not a CGI process.  Is this correct, is PHP running correctly
anyway, and if so, how do I change it?

Any advice much appreciated!

Regards,



DD


_______________________________________________
Blueonyx mailing list
Blueonyx at blueonyx.it
http://www.blueonyx.it/mailman/listinfo/blueonyx




More information about the Blueonyx mailing list