if(!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])) { header('WWW-Authenticate: Basic realm="Secure Area"'); header("HTTP/1.0 401 Unauthorized"); echo "You must enter a username and password."; exit; }