ronenb75 Posted August 31, 2005 Posted August 31, 2005 Hello, How do I get the currect username typed on the pop-up password dialog box after the user is in the protected directory? I mean, the user get the pop-up, type in his user name and password and then I want the php script to grab him username as varabile. Somthing like >$username= .....; I just don't know what is the missing "....." Quote
TCH-Thomas Posted August 31, 2005 Posted August 31, 2005 Welcome to the forum, ronenb75. Sorry don´t know the answer to this but hang tight and someone will know. Quote
ronenb75 Posted August 31, 2005 Author Posted August 31, 2005 Welcome to the forum, ronenb75. Sorry don´t know the answer to this but hang tight and someone will know. <{POST_SNAPBACK}> Thanx..... I'm waiting..... Quote
TCH-Don Posted August 31, 2005 Posted August 31, 2005 Welcome to the forum, ronenb75 I mean, the user get the pop-up, type in his user name and password and then I want the php script to grab him username as varabile. What php script are you using for the log in? it must already be using a variable for the user name. Quote
ronenb75 Posted August 31, 2005 Author Posted August 31, 2005 Welcome to the forum, ronenb75 What php script are you using for the log in? it must already be using a variable for the user name. <{POST_SNAPBACK}> I'm using any script yet. I'm talking about the pop-up that the server brings when you get into protected directories. I'm tring to catch the username from that pop-up windows, but it's script that hidden from us, as much as I know.... Quote
TCH-Don Posted August 31, 2005 Posted August 31, 2005 I think you will need to use your own login script some kind of folder login script I would look on hotscripts.com Quote
ronenb75 Posted August 31, 2005 Author Posted August 31, 2005 I think you will need to use your own login scriptsome kind of folder login script I would look on hotscripts.com <{POST_SNAPBACK}> It's kinda wierd.... the web server should know how the user that login to the pages, it should have been saved somewhere during all the session. Maybe I could read it from a cookie or something.... I asked the support, but don't help with these kind of stuff.... Quote
TweezerMan Posted August 31, 2005 Posted August 31, 2005 Welcome to the forums, ronenb75! There's a number of ways to get the username who logs into a password protected directory. One of the following should work for you: >$username = $_SERVER['REMOTE_USER']; >$username = $_SERVER['PHP_AUTH_USER']; Quote
Ayman Posted August 31, 2005 Posted August 31, 2005 (edited) The username will be in the global variable: $_SERVER['PHP_AUTH_USER'] More info here: http://www.php.net/features.http-auth EDIT: TCH-David was faster than me Edited August 31, 2005 by Ayman Quote
ronenb75 Posted August 31, 2005 Author Posted August 31, 2005 Well done guys <{POST_SNAPBACK}> Thank you both very!!!!! That's was what I needed..... Quote
TCH-Rob Posted September 1, 2005 Posted September 1, 2005 Glad to see we got what you were looking for. Welcome to the forums. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.