This is a simple authentication example that uses the HEADER function to force users to authenticate themselves. It works only if PHP is installed as an Apache module. Instead of simply printing out the $PHP_AUTH_USER and $PHP_AUTH_PW, you would probably want to check the username and password for validity. Perhaps by sending a query to a database, or by looking up the user in a dbm file.
A script that allows you to have a moderately secure page that only users can view. No database required!
You create/remove the users manually with passwords as well.
The SiTeFiLo PHP script is a perfect solution for small sites without SQL server which require user authentication, logging of login attempts and encrypted passwords for less than 100 users.
The simpleauth package is a scheme for allowing users to register a new account on a website. The package uses PHP sessions and a single MySQL table to track users. The system is very, very simple and aimed at beginning PHP users who wish to learn how to allow multiple users to login on their own site. As such the scripts are documented clearly with many comments so you can learn from the scripts.