I have a bit of a problem with variables. namely the PHP_AUTH_USER and PHP_AUTH_PW. When I read them in a program they are blank. but if I run phpinfo from the same directory the fields are populated with the login name and password. Anyone any idea whats going wrong??
Mark
how are you trying to access them?
tried just using them i.e.
$name=$PHP_AUTH_USER
and I have tried
$name=HTTP_SERVER_VARS['
$name = $HTTP_SERVER_VARS["PHP_AUTH_USER"]; should work or $PHP_AUTH_USER
This guy had problems with it too. might be helpfull
http://www.phpbuilder.com/forum/read.php3?num=4&id=573&loc=0&thread=561
In the manuall here is some examples of usage http://www.php.net/manual/pt_BR/features.http-auth.php
Oh on last thing I don't think it works for IIS, so I'm not sure what box your on, but you might need a work around.
Wish I could help more. Good Luck
I am running the PHP as an apache module on a red hat linux box. it just seems odd that I can read the info using phpinfo but not directly.
Oh well Think I will use plan B and use a .htaccess file.