Windows User name

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nick.m
Forum Newbie
Posts: 1
Joined: Sun Jan 22, 2006 4:33 pm
Location: UK

Windows User name

Post by nick.m »

Hi

Is ther a funtion in PHP or mySQL that gets the windows logged in user name please?

I am creating a mysql database which has data for all users but I want the mysql query to return on records for the current windows logged in user

I have an intranet and would like to display a greeting ie good morning <windods username> eth

thanks
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

Very doubtful.

If you REALLY need that functionality, I'd try grabbing their IP with PHP, then using exec to run a c++/java/shell/whatever script to grab their username over the intranet. Although I'm not sure if theres a way to do it with those languages either..
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

If you REALLY need that functionality, I'd try grabbing their IP with PHP, then using exec to run a c++/java/shell/whatever script to grab their username over the intranet. Although I'm not sure if theres a way to do it with those languages either..
*cough* ntlm authentication *cough*
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Try checking the output of:

Code: Select all

echo '<pre>';
print_r($_SERVER);
echo '</pre>';
Should be in there.

Mac
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

twigletmac wrote:Try checking the output of:

Code: Select all

echo '<pre>';
print_r($_SERVER);
echo '</pre>';
Should be in there.

Mac
The windows username won't be in there but the IP address used to connect will be. Often that IP will just be the IP of a gateway/proxy however
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

d11wtq wrote:
twigletmac wrote:Try checking the output of:

Code: Select all

echo '<pre>';
print_r($_SERVER);
echo '</pre>';
Should be in there.

Mac
The windows username won't be in there but the IP address used to connect will be. Often that IP will just be the IP of a gateway/proxy however
I can grab the windows username (NT login ID) from my intranet server at work - spose it depends on the setup.

Mac
Post Reply