HTTP authentication

From: Date: Thu, 15 Feb 2001 07:07:46 +0000
Subject: HTTP authentication
Groups: php.general 
Request: Send a blank email to php-general+get-39851@lists.php.net to get a copy of this message
I was browsing thru the http authentication method given thru the header() function in the manual. I tried it out but it's not giving me the pop-up window asking me the username and password and is only writing the text given in the code on the page. I'm using win98 and otherwise use sun solaris. Does this function work on these two OS? I have to write a code that checks each time a user enters a page, his previously entered user/pwd so as to prevent anyone from entering the page if he knows and writes the page's URL in the address bar. I've used the same authentication method in ASP before for the same. Can I use it in my OS using PHP? The code I'm entering is: <?php if(!isset($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\n"; exit; } else { echo "Hello $PHP_AUTH_USER.<P>"; echo "You entered $PHP_AUTH_PW as your password.<P>"; } ?> Regards, T.Edison jr. ===== Rahul S. Johari (Director) ****************************************** Abraxas Technologies Inc. Homepage : http://www.abraxastech.com Email : abraxastech@yahoo.com Tel : 91-4546512/4522124 ******************************************* __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/

« previous php.general (#39851) next »