April 2026
Intermediate
1009 pages
34h 15m
English
Not leaving HTTP authentication to the server has several advantages:
You don't have to fiddle with a text file or use Apache's not-so-simple database functions, but can instead control everything with PHP.
Compared to IIS, you have the advantage that you do not have to work with user accounts.
You can work (relatively) independently of the web server.
HTTP authentication is quick to implement. Do you remember what happens at the beginning of HTTP authentication? The browser receives HTTP message 401, which you can output using PHP:
header("WWW-Authenticate: Basic realm=\"Application XY PHP\""); header("HTTP/1.1 401 Unauthorized");
Caution: In some configurations, especially in connection with ...
Read now
Unlock full access