tags:

views:

32

answers:

2

i have a secure login using .htaccess, and i need to know which user accessed the area so that my php index can show him his invoices, but the problem is that how to capture the user name when promoted in .htaccess

A: 

Use $_SERVER['REMOTE_USER']; or $_SERVER['PHP_AUTH_USER'];

webdestroya
+1  A: 

You mean HTTP authentication (I think). Apache will add new keys to the $_SERVER variable, named PHP_AUTH_USER, PHP_AUTH_PW, and AUTH_TYPE

Michael Mrozek