Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 85614 invoked from network); 24 Apr 2007 08:21:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Apr 2007 08:21:05 -0000 Received: (qmail 79254 invoked by uid 500); 24 Apr 2007 08:21:00 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 79236 invoked by uid 500); 24 Apr 2007 08:21:00 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 79224 invoked by uid 99); 24 Apr 2007 08:21:00 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Apr 2007 01:21:00 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of neil.hillard@agustawestland.com designates 194.169.33.45 as permitted sender) Received: from [194.169.33.45] (HELO smtp.whl.co.uk) (194.169.33.45) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Apr 2007 01:20:52 -0700 Received: from mail-internal.whl.co.uk ([192.168.255.200] helo=cesium.whl.co.uk) by smtp.whl.co.uk with esmtp (Exim 4.43) id 1HgGGA-0007BP-GL for users@httpd.apache.org; Tue, 24 Apr 2007 09:20:29 +0100 Received: from mc1000-int.gkn-whl.co.uk ([192.168.255.250]) by cesium.whl.co.uk with esmtp (Exim 4.43) id 1HgGG6-0000mp-9k for users@httpd.apache.org; Tue, 24 Apr 2007 09:20:22 +0100 Message-ID: <462DBD4C.4020204@whl.co.uk> Date: Tue, 24 Apr 2007 09:18:20 +0100 From: "Neil A. Hillard" User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: users@httpd.apache.org References: <702684830704240101m11fe717aod0f3c5d7a6aaf166@mail.gmail.com> In-Reply-To: <702684830704240101m11fe717aod0f3c5d7a6aaf166@mail.gmail.com> X-Enigmail-Version: 0.94.1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SA-Do-Not-Run: Yes X-SA-Exim-Connect-IP: 192.168.255.200 X-SA-Exim-Mail-From: neil.hillard@agustawestland.com X-SA-Exim-Scanned: No (on smtp.whl.co.uk); SAEximRunCond expanded to false X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] How to get REMOTE_USER? Hi, Buffalo Dickens wrote: > Dear all, I am eager to know how to get the environment variable > REMOTE_USER of apache 2. > > For example, I wrote this php file, > > > hello > > > >

> Hello, ! >

> > > > However, it just sent output like this, "Hello, !". I don't know why. > Actually, php work fine with apache in my system, which can be > demonstrated by phpinfo() function. So, is it necessary for me to > create files like .htaccess or .htpasswd in order to make my getting > REMOTE_USER right? It seems that there is no REMOTE_USER in my system. You need to tell Apache to authenticate the user. Take a look at: http://httpd.apache.org/docs/2.2/howto/auth.html You should also use: echo $_SERVER['REMOTE_USER'] ensuring you quote the index, see the 'Array do's and don'ts' at: http://www.php.net/manual/en/language.types.array.php HTH, Neil. -- Neil Hillard neil.hillard@agustawestland.com AgustaWestland http://www.whl.co.uk/ Disclaimer: This message does not necessarily reflect the views of Westland Helicopters Ltd. --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org