Using base64_decode(), the User Data Is Readable : base64_decode « Utility Function « PHP






Using base64_decode(), the User Data Is Readable

 
<?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");
}
?>
  
  








Related examples in the same category