Page 1 of 1
Windows User name
Posted: Sun Jan 22, 2006 4:39 pm
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
Posted: Sun Jan 22, 2006 4:46 pm
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..
Posted: Sun Jan 22, 2006 5:05 pm
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*
Posted: Mon Jan 23, 2006 1:11 am
by twigletmac
Try checking the output of:
Code: Select all
echo '<pre>';
print_r($_SERVER);
echo '</pre>';
Should be in there.
Mac
Posted: Mon Jan 23, 2006 7:07 am
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
Posted: Mon Jan 23, 2006 7:15 am
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