How to get apache authenticated user info in PHP ?

I am using apache 2.01 for my website in fedora core 3.

I am using basic database authentication using mod_auth_mysql and authenticating the users from my own database.

My problem is, I have certain other columns in my database apart from username and password which I need to know when a user logs in. I intend to use these fields for other activities like personalization of the page etc.

How do I know the username using which the user has logged in so that I can get the other columns info in the table ? Is it possible to know at all ?

I am using php for this.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can, with your own function.
Check the username and password manually (by query), then if found, retrieve all other information of that user, and store them in a session variable.

Then you can retrieve them back on any other page, as long as you use: session_start() at the beginning of each page.

Please let me know if you need more info.
mganeshAuthor Commented:
Thanks my friend. This I have done many times.
But my problem is, I am using apache basic authentication using mysql database and am not using my own login page for authentication.

Based on the previous posts:

Should be this variable:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.


This link tells you about the implementation of what you wanted. Hopefully it helps.
How did you go with this?
mganeshAuthor Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.