Jump to content

How to retrieve windows logged on user information?


sasha

Recommended Posts

Hello.
I ma fighting with one problem for about 2 weeks and cannot find any solvation.
I build a site which gonna run in a private ,domain based network, and I need a script in php which will retrieve the username of the corrent logged on to windows user.

Hope that you can help.
Thank you, sasha.
Gives the username of the user currently running the script.
[code]<?php
$domuser = $_SERVER['LOGON_USER'];
list ($domain, $username) = explode ('\\', $domuser);  // use '\\\\' on some servers

echo "Your username is $username";
?>[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.