News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sree's Blog:
HTTP Authentication with PHP
December 05, 2005 @ 07:16:00

From Sree's blog today, there's this look at a method for doing "HTTP Authentication with PHP".

Basic HTTP authentication uses a challenge/response scheme to authenticate users attempting to access a password-protected page. The challenge process begins when the user requests a file from a Web server. If the username and password pair is valid, the protected file will be displayed to the user.

A simple PHP script can mimic the HTTP authentication challenge/response system by sending the appropriate HTTP headers that cause the automatic display of the username/password dialog box.

They give all of the code to make it possible. However, it does make use of the globals that you might not have access to if your hosting provider has them turned off. In that case, you can use $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PASS'], and $_SERVER['PHP_AUTH_TYPE'] instead...

Thanks to Nexen.net for the pointer.

0 comments voice your opinion now!
http authentication http authentication


blog comments powered by Disqus

Similar Posts

Mike Wallner's Blog: Dropping server load with HTTP caching

Mike\'s Blog: PECL HTTP module - A nasty bug and a new example

PHPMaster.com: Understanding OAuth - Tweeting from Scratch, Part 2

PHP Security Blog: Goodbye HTTP Response Splitting, and thanks for all the fish

Splitbrain.org: OpenID for DokuWiki


Community Events





Don't see your event here?
Let us know!


introduction tips laravel zendserver framework interview language release list community symfony voicesoftheelephpant code series threedevsandamaybe api conference deployment bugfix podcast

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework