Re: get current username from the windows system

From: Date: Thu, 23 Jan 2003 11:47:49 +0000
Subject: Re: get current username from the windows system
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-132793@lists.php.net to get a copy of this message
$_SERVER['LOGON_USER'] also works. ---John Holmes... ----- Original Message ----- From: "James Lobley" <james@westcoast.co.uk> To: "'Thomas Franz'" <thomas.franz@esv-siershahn.de>; <php-general@lists.php.net> Sent: Thursday, January 23, 2003 6:05 AM Subject: RE: [PHP] get current username from the windows system > Hi Thomas, > > The following code should help you... > Note that you have to turn off anonymous access in IIS, so that the user > authenticates to a domain. > > <? > $ip = getenv("REMOTE_ADDR"); > echo("IP address is $ip<BR>"); > > $user_chunks = explode("\\",strtoupper(getenv("REMOTE_USER"))); > $user_domain = $user_chunks[0]; > $user_name = $user_chunks[1]; > > echo("User domain is $user_domain<BR>"); > echo("User name is $user_name<BR>"); > ?> > > > James > > > -----Original Message----- > From: Thomas Franz [mailto:thomas.franz@esv-siershahn.de] > Sent: 23 January 2003 10:44 > To: php-general@lists.php.net > Subject: [PHP] get current username from the windows system > > > Hi. > > is their a possibilty to get the windows username of the current logged on > user with php. > > I want this to make a logon dialog more comfortable. > > Thanks for an answer and a little example if it's possible. > > Thomas > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > This email is only intended for the person(s) to whom it is addressed and > may contain confidential information. Unless stated to the contrary, any > opinions or comments are personal to the writer and do not represent the > official view of the company. If you have received this e-mail in error, > please notify us immediately by reply e-mail and then delete this message > from your system. Please do not copy it or use if for any purposes, or > disclose its contents to any other person. > > We make every effort to keep our network free from viruses. You should > independently check this e-mail and any attachments for viruses, as we > can take no responsibility for any computer viruses that might be > transferred by way of this e-mail. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#132793) next »