473,471 Members | 1,728 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 67632

"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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.