Use only two global PHP variables $PHP_AUTH_USER and $PHP_AUTH_PW containing the username and the password that accompanied the current HTTP request and one PHP function header() to respond with a HTTP 401 error if username and/or password failed.




Leave a Comment