Re: Why not user...?

From: Date: Tue, 28 Aug 2007 06:18:42 +0000
Subject: Re: Why not user...?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-261401@lists.php.net to get a copy of this message
Hi! Thnank you for your input, but I used AUTH_USER-server variable instead of PHP_AUTH_USER and that did the trick! :-) Best regards /Gustav W iberg ----- Original Message ----- From: "Richard Lynch" <ceo@l-i-e.com> To: "Stut" <stuttle@gmail.com> Cc: "Gustav Wiberg" <gustav@hmn.se>; "PHP General" <php-general@lists.php.net> Sent: Tuesday, August 28, 2007 3:20 AM Subject: Re: [PHP] Why not user...?
On Mon, August 27, 2007 8:51 am, Stut wrote:
Gustav Wiberg wrote:
Why is it so that I get this error. I'm using Windows Integrated authorization-method for actual webb I'm testing on. Notice: Undefined index: PHP_AUTH_USER in C:\www\utveckling\username.php on line 2
For some reason it's not getting set. This could be because you've not configured IIS correctly, are you sure you've disabled anonymous authentication? If you're sure it's configured correctly try var_dump'ing $_SERVER - it's possible (though unlikely) the username is in another place.
Going for the more obvious... Did you perhaps take code written with the default setting of E_ALL ~ E_NOTICE and are now running it with E_ALL, and this is the first page-view before you've even typed in your usernane/password? Cuz that for sure would do it. Change the code to be more like this: if (isset($_SERVER['PHP_AUTH_USER'])){ //try to login } You'll probably have a fair number of these E_NOTICE thingies to fix before you are through. They're all trivial to fix, and there's no real excuse to have code that has E_NOTICE messages firing off anyway. Under extreme pressure, you can switch to E_ALL ~ E_NOTICE for this app for now and put it on the ToDo list to fix it right someday... -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?


« previous php.general (#261401) next »