Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

$HTTP_SERVER_VARS['REMOTE_USER'] is blank

Status
Not open for further replies.

lowbk

Technical User
Nov 26, 2001
162
SG
hi, i am new to PHP and i am using win2003server, IIS, PHP and mysql. when i tried the following,
Code:
$user=$HTTP_SERVER_VARS['REMOTE_USER'];
echo "hey $user!";
it shows hey ! may i know what settings do i have to check?
or should i post this under IIS?
 
Which PHP version are you using? If it is 5 then long array names are turned off by default and you should use the short superglobals: [tt]$_SERVER['REMOTE_USER'][/tt].
 
I don't see $_SERVER['REMOTE_USER'] listed in the PHP online manual.

A user-supplied comment on that page says $_SERVER['REMOTE_USER'] is the same thing as $_SERVER['PHP_AUTH USER']. The "gotcha" is that PHP has to be running as a web server module (of ISAPI filter with IIS) for this to be available. Running PHP as a standalone CGI won't work.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
do you mean
Code:
$_SERVER['REMOTE_ADDR']
to get the client ip address? you did not say what you thought you should see....[ponder]

Binary Intelligence, true or false?
 
litton1, i was trying to use $HTTP_SERVER_VARS['REMOTE_USER'] to get the loginID. EG if the user logged in as USER1 in windows, then $HTTP_SERVER_VARS['REMOTE_USER'] should capture USER1.

but perhaps i have used the wrong method. if $HTTP_SERVER_VARS['REMOTE_USER'] is unable to capture the loginID, may i ask what is the correct method?
 
next question, do you mean for apache or windows or Linux, you can get a windows username (i think) with
$_SERVER['LOGON_USER']


Binary Intelligence, true or false?
 
litton1, thanks. $_SERVER['LOGON_USER'] is what i was looking for.
 
Glad i could help :)

Binary Intelligence, true or false?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top