473,574 Members | 18,283 Online
Bytes | Software Development & Data Engineering Community
+ 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 67683

"Johan den Boer" <me@knoware.n l> wrote in message
news:vq******** ****@corp.super news.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.ne t | forum.digiserv. net
Programming, Web design, development & hosting.

Jul 17 '05 #4
Johan den Boer <me@knoware.n l> 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$p l3.105712@pd7tw 3no>, 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
8845
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 please as I've hit a deadend: Thanks CODE:
8
3943
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 of usernames is stored on the server side in a xml based file So what I am doing at the moment is inside the user control pageload method, i get...
2
1193
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 = WindowsIdentity.GetCurrent() txtUser.Text = ident.Name What do i need to find username?
5
5466
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 ,I appreciate it.
8
16661
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 Username? Is there any way of doing so? Through the Intranet?
1
2458
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 with Java Script?
11
9286
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. Is this even possible with coldfusion or should I be looking to asp?
4
4174
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 the ms access field. here i steh code that i'm using. please help <SCRIPT type=text/javascript> <!-- var WinNetwork = new...
8
12542
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"); System.out.println("Window's Username: "+userName); return userName; }
0
7738
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8081
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7835
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5635
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5325
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3759
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2255
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 we have to send another system
1
1360
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1084
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.