473,396 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

retrieve windows username in php

Hi,

I am new to php. Is it possible to find out the windows user name in php ?

Logon in windows domain with 'user1'. I want to get the username in php in
my example : user1.

How do you that ?

thanks
Jul 17 '05 #1
7 67616

"Johan den Boer" <me@knoware.nl> wrote in message
news:vq************@corp.supernews.com...
Hi,

I am new to php. Is it possible to find out the windows user name in php ?

Logon in windows domain with 'user1'. I want to get the username in php in
my example : user1.

How do you that ?

thanks


Short answer = NO

Long answer: PHP is a server side language - it will read headers and form
data sent by the client browser, but it cannot request the data. I don't
believe Javascript has access to this information either but I believe
ActiveX or perhaps ASP *might* give you this information...

To get a rough idea of what information PHP does read from a client web
browser, write the following simple script in to a file and visit it with
your web browser

<?
phpinfo();
?>

Note: Different browsers deliver different headers so you cannot rely that
all the information you see in phpinfo() will be avialable every time...
Jul 17 '05 #2
Johan den Boer wrote:
Hi,

I am new to php. Is it possible to find out the windows user name in php ?

Logon in windows domain with 'user1'. I want to get the username in php in
my example : user1.

How do you that ?


If you mean client-side then no, not with PHP. That kind of information
is not transmitted with the HTTP headers.

And I don't know what it would good for on the server-side, since it
would most probably be the same all the time.

Jul 17 '05 #3
On Fri, 31 Oct 2003 12:14:55 +0200, Daniel Bengs wrote:
And I don't know what it would good for on the server-side, since it would
most probably be the same all the time.

Can't say I've tried, but I believe the info is in the manual about this
(with some pre-req's of some kind?), but as for how useful, I see your
point, if it's an Internet site.. but what if the OP is asking for info on
an Intranet? the windoze login could be as useful as perhaps, .htaccess /
..htpasswd authentication recognition. Not everyone is developing "public
Internet" sites (I obviously don't know for sure what the OPs targets are) =)

Regards,

Ian

--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.

Jul 17 '05 #4
Johan den Boer <me@knoware.nl> wrote:
I am new to php. Is it possible to find out the windows user name in php ?

Logon in windows domain with 'user1'. I want to get the username in php in
my example : user1.


Hi Johan,

If the web server is in the same domain, i.e. intranet, try echoing
$_SERVER['LOGON_USER'] and $_SERVER['AUTH_USER']. Might only work with IE
though.

A good start is generally having a phpinfo() running to check what headers &
information the browser sends to the server.

JOn
Jul 17 '05 #5
Johan den Boer wrote:
Hi,

I am new to php. Is it possible to find out the windows user name in php ?

Logon in windows domain with 'user1'. I want to get the username in php in
my example : user1.


To do this you need to add an extra module to Apache (assuming Apache
not IIS). This will do a lookup on the domain controller to work out who
the user is.

http://modntlm.sourceforge.net/

Jul 17 '05 #6
Carved in mystic runes upon the very living rock, the last words of
Johan den Boer of comp.lang.php make plain:
Logon in windows domain with 'user1'. I want to get the username in
php in my example : user1.


You might have more success asking in a Windows and/or IIS forum, as to how
you can get the user name into the server environment.

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Jul 17 '05 #7
In article <T%mob.229825$pl3.105712@pd7tw3no>, Randell D.'s output was...


Long answer: PHP is a server side language - it will read headers and form
data sent by the client browser, but it cannot request the data. I don't
believe Javascript has access to this information either but I believe
ActiveX or perhaps ASP *might* give you this information...


Snip

Not sure if this is patched yet, but.......

http://www.insecure.org/sploits/NT.N...ntication.html

may be of some use to you. Plug in a sniffer and see what's happening...

Also, stepping away from PHP, and into some client-side scripting:

http://beta.experts-exchange.com/Web..._20717958.html

might help you out.
Jul 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Newbie | last post by:
I am a newsbie to ASP but need to get a script together that will insert the Windows Username of the local machine into an access database. I get the errors from my code below, can anyone help me...
8
by: Raj Thakkar | last post by:
Hi, I am currenty working on a site for intranet. I have a user control in the header of every page that will be displayed only if people with certain username are surfing the site. These lists...
2
by: Child | last post by:
my application needs to retrieve windows username - anon authentication is OFF, auth mode in web.config is "windows". I get machine name with Dim ident As WindowsIdentity =...
5
by: nikou_70 | last post by:
I have a problem with ("auth_user") in asp,I try to use windows username and password in asp page for limitation user access to pages, but this server variable returns empty string, can you help me...
8
by: Bruno Barros | last post by:
Hey there. I'm currently working on an intranet, and would like to know how I can get the windows usernames of the visitors. You can get their IP with $_SERVER; But what about their Windows...
1
by: hemel | last post by:
I am going developed a web site where all user have registered with their windows username. So I want to USER NAME fild automically fillup with windows username. How can i do this? Is it possible...
11
by: dmorand | last post by:
I'm trying to retrieve the username of the user logged into a machine when a person visits my page on our intranet. I've looked over cfntauthenticate but that's not going to do what I need it to do....
4
by: orajat | last post by:
hi, I'm trying to pull the windows username with jscript and save it to ms access field in a table, but it does not work. it does show the alert with the name of the user but does not save it to...
8
by: tiijnar | last post by:
Hi, To get windows username Im using the following code. public class GetWindowUsername { public String getUser() { String userName = System.getProperty("user.name");...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.