Simple PHP HTTP Authentication

Sometimes you may want to hide the contents of a page (e.g. admin page) in a very simple manner. The best and simplest method is to use the PHP’s built in HTTP authentication. It’s both secure and compatible with 99% of your visitor’s browsers.

The authentication code must be at the top of the PHP script, otherwise you will usually get a “Headers Already Sent” error.


[ad name=”In Post”]

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.