Does anyone know how to access a clients windows username using PHP on a IIS server? Thanks for any help.
Can PHP on IIS read username of client?
The answer is; you can't.
Well, I suppose there are ways to do it, but not using only PHP on IIS. If you create a Java-applet, you might be able to do it, and it might be possible with Javascript, even though I find that unlikely..
Good luck, and let us know if you find a sollution..
//Olle
A search thru the forums dug this up
if you enable "Integrated Windows Authentication" and disable anonymous access to your server (i'm assuming that you are using IIS 5.0+), then you can use the $_SERVER['AUTH_USER'] variable, which is the domain logon.
I'm sure this is correct, but then one has to consider the impact on users using other browsers and operatingsystems. Sure, on could say that this doesn't matter; the target audience all use the same software, but what happens when their software becomes obosolete, or maybe someone decides to break/change that standard? It's (according to me) never good to rely on non-standard functions, as this usually creates problem further down the road.
//Olle
personally i always assume that if someone's asking to get a windows username then they're working on an intranet site - hence you'll know exactly what OS's or platforms they'll be using.
Dont know why that is, but probably because thats the only reason i can think of anyone wanting such information - it would be meaningless in any other environment.