View Full Version : windows login

02-13-2003, 06:17 AM
i am writing the schools intranet and i need to know if there is a script which retrieves the username of the current logged in user on the clients machine and displays it on the webpage.

02-13-2003, 11:30 AM
Since your signature tells us that you are already programming for a really long time, you shouldn't have any problems to figure out the answer to your question yourself.

Hint: PHP runs on the server, not on the client.

02-13-2003, 11:48 AM
i know it can be done in ASP. problem is i dont know how to do it in PHP.


02-13-2003, 01:18 PM
I also program my schools intranet and I don't think that there is a way to the user that is logged on.

I tried this as Our school was going to have the set of flash valentines cards that I made, but we needed to make sure that nothing offensive was sent in the message, so I wanted to make a tracking system that would return all offensive messages from whichever user.

I was never able to do it.:(

02-13-2003, 08:28 PM
it can be done.

at work on some of our intranet sites, it says welcome (our username here), is this what you are talking about? if it is I THINK it has something to do with some of the php environmental variables like REMOTE_ADDR etc.

maybe REMOTE_USER???

02-13-2003, 08:32 PM
Can I just clarify here, Do you want it to get the username that you use to log on to the user area of the computer ( network username )

02-13-2003, 09:06 PM
If you check the

server var it will have the domain\\user

But you must be using IIS on a lan and have the security setting set for NO Anonymous access and check the Intergrated Windows authentication.


You MUST turn on keep-alives!

IE supports this but I think netscape does not (on the client side).

02-14-2003, 09:09 AM
you can authenticate against NT user on apache using (there are a couple of others), mod_sspi when athenticated, I assume the username is available somewhere in the $_SERVER array , though I doubt that this will be set unless you get the user to authenticate in the first place?

02-14-2003, 07:39 PM
The settings I discribe in IIS force IIS to do NTFS challange - responce authentication. If the info IE sends to the IIS box doesn't pass the authentication test, IIS pops up a login box. This allows the user to supply a different set of login info that the ones the pc used to get onto the lan.

I have never done this with apache. Sorry can't help yea there.

I would like to do windows authentication with apache, I will go look up some info on that module. Any good reading links out there?

02-15-2003, 12:38 AM
Hi, mod_auth_sspi info @ http://www.syneapps.com/software/mod_auth_sspi/ its apache2 only at the moment though I know there is a 1.3.* version knocking around cos I have a copy somewhere , good place (though a dodgy interface) for apache module info is http://modules.apache.org/search