PHP:
<?php
$bolge = "sifre ";
$kad = "selcuk";
$sifre = "selcuk";
if ($_SERVER["PHP_AUTH_USER"] == "")
{
header ("WWW-Authenticate: Basic realm=\"$bolge\"");
header("HTTP/1.0 401 Unauthorized");
echo "<html><head><title>Robot Security Guard </title></head><body bgcolor='white'><font color=red><br><br>";
echo "<center></center></body></html>";
exit ();
}
else
{
if ( ($_SERVER["PHP_AUTH_USER"] !=$kad) ||
($_SERVER["PHP_AUTH_PW"] != $sifre) )
{
header ("WWW-Authenticate: Basic realm=\"$bolge\"");
header("HTTP/1.0 401 Unauthorized");
echo "Robot Security Guard Active !";
exit();
}
}
?>