[php]require "config.php";
// Admin Bereich Passwort Abfrage
function httpAuthenticate($strRequiredUser, $strRequiredPw, $strRealm = "Ausgabe") {
if (!array_key_exists("PHP_AUTH_USER", $_SERVER)
|| $_SERVER["PHP_AUTH_USER"] != $strRequiredUser
|| $_SERVER["PHP_AUTH_PW"] != $strRequiredPw) {
header(‚WWW-Authenticate: Basic realm="‘.$strRealm.’"‘);
header("HTTP/1.0 401 Unauthorized");
exit("Keine Berechtigung");
}
}
httpAuthenticate($user, $pass);[/php]
config.php
[php]
<?php
$user = "Username";
$pass = "Password";
?>
[/php]