CODE
// BEGIN .htaccess by DarkRider
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="Restrict Access!"');
header("HTTP/1.0 401 Unauthorized");
exit;
} else {
$userinf=$DB_site->query_first("SELECT user.password,user.userid,user.salt FROM user WHERE username='$_SERVER[PHP_AUTH_USER]'");
}
$salt = $userinf['salt'];
$pass = $userinf['password'];
$userp = md5(md5($_SERVER['PHP_AUTH_PW']) . $salt);
if ($pass != $userp) {
header('WWW-Authenticate: Basic realm="Restrict Access!"');
header('HTTP/1.0 401 Unauthorized');
exit;
}
// END .htaccess by DarkRider
}
This is a nice option too