Computing.Net > Forums > Web Development > Retrieving .htaccess info

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Retrieving .htaccess info

Reply to Message Icon

Name: Spinal
Date: September 3, 2004 at 04:25:11 Pacific
OS: irrelevant
CPU/Ram: enough
Comment:

Hello! I'm having a little problem, on a section of my site, users have to log into a .htaccess password protected area. Ideally, once they log on, in the top right hand corner (for example) it says " Welcome Joe Blogs". The name should be retrieved from the info they entered in the .htaccess login part. Anyone know how to do this? I don't mind storing the name in a cookie on their computer, so maybe that will work. But I have no idea how to retrieve the username.
Thanks,
Spinal




Sponsored Link
Ads by Google

Response Number 1
Name: -Bryan-
Date: September 3, 2004 at 09:21:13 Pacific
Reply:

Hi.

$_SERVER['REMOTE_USER'] will give you what you're looking for. However, remember that it will only display the username entered in the htaccess file, i.e. joeblogs or whatever the username might be.


To get the user's full name, something like "Joe Blogs" from that, you'll have to match the username to the person's actual name, presumably from a mySQL database. That's also easy to do and I'd be happy to go into that if you need me to.



0
Reply to Message Icon

Related Posts

See More


Problem viewing pics Free forum host



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Retrieving .htaccess info

cookies via numerous languages www.computing.net/answers/webdevel/cookies-via-numerous-languages/3590.html

.htaccess ? www.computing.net/answers/webdevel/htaccess-/569.html

cant access webpage outside lan ..? www.computing.net/answers/webdevel/cant-access-webpage-outside-lan-/3045.html