Re: [PHP] newbie basic realm protection - why don't the input usr/pass stick?

2010-12-08 Thread Govinda
you script looks (and works) fine. so i dont think the problem is in  
your script


I found firebug/live http headers firefox addons to be helpful in  
this situation

see if your client is actually sending Authorization  Basic header

Kranthi.
http://goo.gl/e6t3


Kranthi, thanks for looking.. I did find out with the help of the  
host.. that the issue was because PHP was running in fastcgi mode  
instead of apache module mode.  Now it is behaving as expected.


-Govinda

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] newbie basic realm protection - why don't the input usr/pass stick?

2010-12-07 Thread Govinda

Hi everyone

I am hacking my way through something unrelated to this post.. but  
needed to stop and (real quick) pass-protect a page to use it to run  
some quick (*admin-only*) scripts on a shared host.
..and I see now how poor is my understanding of what seems like basic  
stuff.  As a start for my quick understanding to pass protect a page,  
I used the Example #6 Basic HTTP Authentication example, from here:

http://www.php.net/manual/en/features.http-auth.php
..which is just this:

?php
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm=My Realm');
header('HTTP/1.0 401 Unauthorized');
echo 'Text to send if user hits Cancel button';
exit;
} else {
echo pHello {$_SERVER['PHP_AUTH_USER']}./p;
echo pYou entered {$_SERVER['PHP_AUTH_PW']} as your password./ 
p;

}
?

..and no matter what i type in the authentication dialogue that pops  
up.. then after I submit it.. it just keeps looping forever popping up  
the dialogue..  I.e. I never get past the authenticate dialogue to see  
this line executed:

echo pHello {$_SERVER['PHP_AUTH_USER']}./p;

What am I missing?

Thanks for your bothering to help with this,


Govinda


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] newbie basic realm protection - why don't the input usr/pass stick?

2010-12-07 Thread Kranthi Krishna
you script looks (and works) fine. so i dont think the problem is in your script

I found firebug/live http headers firefox addons to be helpful in this situation
see if your client is actually sending Authorization   Basic header

Kranthi.
http://goo.gl/e6t3

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php