Click to See Complete Forum and Search --> : <?php echo $AUTH_USER; ?> Not Showing Info.
d.brandusa
05-10-2004, 03:28 PM
This used to work for me to display the username/domain:
<?php echo $AUTH_USER; ?>
How I get error:
Notice: Undefined variable: AUTH_USER in view.php on line 1
Is there something that is configured wrong in my php.ini or the server not allowing this information.
I am running windows 2000 with iis server.
Paul Jr
05-10-2004, 07:24 PM
Most likely register_globals is off, which is a good thing, so you have to access that through the $_SERVER superglobal:
<?php echo $_SERVER["AUTH_USER"]; ?>
d.brandusa
05-10-2004, 11:11 PM
I receive this error with that script.
Notice: Undefined index: AUTH_USER in detection.php on line 1
The Cheat
05-10-2004, 11:51 PM
What is auth_user? I dont see it in the manual...
Paul Jr
05-11-2004, 04:15 PM
Sorry, my bad, I didn’t read carefully enough.
$_SERVER["PHP_AUTH_USER"];
d.brandusa
05-11-2004, 04:22 PM
Thanks for trying, is there something set wrong with my php.ini. I get error: Notice: Undefined index: PHP_AUTH_USER in detail.php on line 1
With code:
<?php echo $_SERVER["PHP_AUTH_USER"]; ?>
Paul Jr
05-11-2004, 04:30 PM
Are you running under Apache?
From the PHP Manual on the PHP_AUTH_USER $_SEVRER superglobal property
When running under Apache as module doing HTTP authentication this variable is set to the username provided by the user.
d.brandusa
05-11-2004, 04:32 PM
we are running windows 2000, iis server. I know this worked before, it stopped recently. I don't what the deal is! I don't remember modifying any files on the server.