Skip to content

Instantly share code, notes, and snippets.

View javierjara's full-sized avatar

Javier Jara javierjara

  • Milan, Italy
View GitHub Profile
//----------------------------------------------------------------------
// AUTENTICAZIONE
//----------------------------------------------------------------------
if (isset($_SERVER['HTTP_AUTHORIZATION'])) {
$nobasic = substr($_SERVER['HTTP_AUTHORIZATION'], 6); // removing 'Basic ' from the string
$decoded = base64_decode($nobasic); // decoding string with user:password
list($client_user, $client_pass) = explode(':', $decoded);
if ($client_user == "hearst" && $client_pass == "hearst12") {
// Successfully authenticated
} else {