// basic auth
if (
!isset($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) ||
($_SERVER['PHP_AUTH_USER'] !== 'admin' && $_SERVER['PHP_AUTH_PW'] !== 'test')) {
header('WWW-Authenticate: Basic realm="Enter username and password for admin page."');
header('Content-Type: text/plain; charset=utf-8');
die('このページを見るにはログインが必要です。');
header('Content-Type: text/html; charset=utf-8');
}
0 comments:
Post a Comment