Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 22nd, 2006, 12:17 PM
Registered User
 
Join Date: Mar 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Windows Username in PHP



Hi

I have a php application (with mysql underneath) and I need to get the Windows username. I need the name that they logged into the machine with. The machine is either Windows 2000 or XP.

Any ideas?

Thanks!

Jim

 
Old March 29th, 2006, 12:36 AM
Authorized User
 
Join Date: Mar 2006
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try using getenv('username') OR $_ENV['username'].

Regards
Milind

 
Old March 29th, 2006, 11:40 AM
Registered User
 
Join Date: Mar 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply!

That gives who the server is logged in as and not the Windows name of the person using the server. It does not matter my Windows login, I always get the name of the user on the server that the software is running under. I need the Windows login name.

Any other thoughts?

Thanks again!

Jim
 
Old April 9th, 2006, 01:12 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Not sure how you'd go about it, but I'd start with looking at how to access Active Directory from PHP, you'd probably get some clues from that. A search on Google turns up some promising hits.

http://www.google.com/search?q=PHP+W...tive+Directory

Regards,
Rich

--
Author,
Beginning CSS: Cascading Style Sheets For Web Design
CSS Instant Results

http://www.catb.org/~esr/faqs/smart-questions.html





Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Installation on Windows XP asifah30 Beginning PHP 1 July 9th, 2007 12:18 PM
PayPal's PHP SDK on Windows s2j1j1b0 PHP How-To 1 May 27th, 2007 05:56 AM
PHP in windows enviroment ash1574 Beginning PHP 2 May 15th, 2007 04:03 AM
Problem moving php from linux to windows skn8956 Beginning PHP 1 July 9th, 2004 06:21 PM
Help with setting up PHP with apache2 on windows mfowler Beginning PHP 3 November 5th, 2003 09:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.