Re: HTTP authentication

From: Date: Thu, 15 Feb 2001 14:49:00 +0000
Subject: Re: HTTP authentication
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-39902@lists.php.net to get a copy of this message
I'm sure this wont' help, but just in case you may have missed the obvious (it happens sometimes<g>)..Make sure you PHP script has the extension .PHP .. The server won't recognize it as a PHP file otherwise, and it won't know what to do with it. Also this extension has to be registred properly on the server, but that is beyond me. - John Vanderbeck - Admin, GameDesign ----- Original Message ----- From: "Thomas Edison Jr." <thomasedisonjr@yahoo.com> To: <php-general@lists.php.net> Sent: Thursday, February 15, 2001 2:07 AM Subject: [PHP] HTTP authentication > 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/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#39902) next »