RIRedinPA Posted November 18, 2010 Share Posted November 18, 2010 This is kind of out of my realm so excuse any comments/questions that don't make sense. I am working on a internal site that will sit on a server which requires the user to use their Active Directory username and password to access. Once they authenticate the server will then load my page. Is there a way for me to get the username that they used to log in - I'll be using it to pull up their data stored in a MySQL db and configure the page for them. Thanks. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted November 18, 2010 Share Posted November 18, 2010 I assume you're using some sort of form to log them in, right? Is there a reason you couldn't just populate a $_SESSION var with the contents of the username field when they submit the form, or does it use a different method to authenticate? Quote Link to comment Share on other sites More sharing options...
RIRedinPA Posted November 18, 2010 Author Share Posted November 18, 2010 No, that's the problem, the login window is being generated by the browser I assume by a request from the server? I thought of putting a page up with a form and storing the username through a session but then it reverses my question, how do I pass the username/password back to apache to authenticate - the site is going to be behind a https wall. I hope that makes sense, like I said, not my area of competence. You can't get on the server until you authenticate. So either way, I need to talk to apache. Quote Link to comment Share on other sites More sharing options...
RIRedinPA Posted November 18, 2010 Author Share Posted November 18, 2010 I solved it: <?PHP $User = $_SERVER[ "REMOTE_USER" ]; print "Your username is : $User"; ?> Quote Link to comment Share on other sites More sharing options...
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.