ale1981 Posted June 8, 2006 Share Posted June 8, 2006 I am creating an intranet for our company and want to know if there is a way I can extract the current logged in username from windows to use in the intranet. I can get the username using vbScript but how do I pass a variable from vbScript to php? Is there any way I can do this?Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/11513-php-and-windows/ Share on other sites More sharing options...
thepip3r Posted June 8, 2006 Share Posted June 8, 2006 FOR IIS:When you create the site, right click on it, go to properties. Click on the Directory Security tab. Edit "Anonymous access and control". From here, ensure anonymous access is NOT checked and make sure that Integrated Windows authentication IS. Once this done, check your $_SERVER['AUTH_USER'] var and your complete domain\hostname should be listed. If not, view phpinfo() and see if you can find your username in some other similar variable. With the above set, the Windows username should be listed in one of your Global variables. I'm currently using this method on two seperate sites right now. Link to comment https://forums.phpfreaks.com/topic/11513-php-and-windows/#findComment-43315 Share on other sites More sharing options...
.josh Posted June 8, 2006 Share Posted June 8, 2006 vbscript:[code] If UserName <> "Unknown" then document.location = "target.php?username=" & UserName[/code]target.php[code]if ($_GET['username']) { $username = $_GET['username'];}[/code] Link to comment https://forums.phpfreaks.com/topic/11513-php-and-windows/#findComment-43316 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.