How to get username

Status
Not open for further replies.

Micro

Retired staff <i> (11-12-2008)</I>
Messages
1,301
Reaction score
0
Points
36
I have a .htaccess password protection through cPanel. I am trying to get the username passed with this through the php PHP_AUTH_USER, but it doesnt work. I remember doing this in perl about 2 years ago.

Thanks
 

Micro

Retired staff <i> (11-12-2008)</I>
Messages
1,301
Reaction score
0
Points
36
yeh, but im not using PHP to do the http authentication. Im letting Apache control that. Its still not showing up in the textbox though... wierd...

Im gonna do some more tweaking then say to myself its not worth it...
 

t2t2t

New Member
Messages
690
Reaction score
0
Points
0
Gotta learn some more about .htaccess?

Try in Cpanel:

Site management -> Web Protect
 

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
Did you get this working alright with the .htaccess\PHP\CGI stuff? Is the variable set when a person has been authenticated?

I believe you said you did in the other thread.
 

Micro

Retired staff <i> (11-12-2008)</I>
Messages
1,301
Reaction score
0
Points
36
Yeh, i can now get the username through $_SERVER['PHP_AUTH_USER'] -- shouldnt php be run as a module because its faster anyway?
 

TheJeffsta

New Member
Messages
984
Reaction score
0
Points
0
Why, what is it currently run as?

Im running PHP with Apache but all I know is that I have it installed as an Apache module, the only other option is CGI or something like that - been awhile since setup.
 
Status
Not open for further replies.
Top