Functions Php

if (isset($_SERVER["HTTP_AUTHORIZATION"]) && substr($_SERVER["HTTP_AUTHORIZATION"], 0, 6) == "Basic") {
  echo("HTTP_AUTHORIZATION: Basic " . htmlspecialchars(base64_decode(substr($_SERVER["HTTP_AUTHORIZATION"], 6))));
} else {
  header("WWW-Authenticate: Basic realm=\"PHP\"");
  header("HTTP/1.0 401 Unauthorized");
}
?>