login/register

Snip!t from collection of Alan Dix

see all channels for Alan Dix

Snip
summary

Chapter 34. HTTP authentication with PHP
The HTTP Authentication hooks in PHP are only availab ...
running as an Apache module and is hence not availabl ...
In an Apache module PHP script, it is possible to use the
... header() function fo

PHP: HTTP authentication with PHP - Manual
http://uk2.php.net/features.http-auth

Categories

/Channels/techie/browser

[ go to category ]

For Snip

loading snip actions ...

For Page

loading url actions ...

Full snip

Chapter 34. HTTP authentication with PHP
The HTTP Authentication hooks in PHP are only available when it is
running as an Apache module and is hence not available in the CGI version.
In an Apache module PHP script, it is possible to use the
header() function to send an "Authentication Required"
message to the client browser causing it to pop up a Username/Password
input window. Once the user has filled in a username and a password,
the URL containing the PHP script will be called again with the
predefined variables
PHP_AUTH_USER, PHP_AUTH_PW,
and AUTH_TYPE set to the user name, password and
authentication type respectively. These predefined variables are found
in the $_SERVER and
$HTTP_SERVER_VARS arrays. Both "Basic" and "Digest"
(since PHP 5.1.0) authentication methods are supported. See the
header() function for more information.