Best way to do it:
.htaccess
.htpasswd
(apache security)
Another way:
Call from your protected site:
<?
If ($REQUEST_METHOD==\"POST\") include \"auth.inc\";
$connect = DBoeffnen($db);
?>
<HEAD>
<TITLE>Ausgabe</TITLE>
</HEAD>
auth.inc:
<?
Function no_authentification()
{
Header(\"WWW-authenticate: basic realm=MySQL-Admin\");
Header(\"HTTP/1.0 401 Unauthorized\");
echo \"<h1>Sie benötigen eine gültige Kennung.</h1>\";
exit;
}
If (!isset($PHP_AUTH_USER))
{
no_authentification();
}
Else
{
If ($PHP_AUTH_USER != \"user\"
|| $PHP_AUTH_PW != \"password\")
{
no_authentification();
}
}
?>