There are almost no differences in the two aspects of safety. but all the problems of Pekka. If you just want to use HTTP Basic Auth (i.e. Popup) as opposed to the login form, you can do this via PHP. if you are looking $_SERVER['PHP_AUTH_USER'], and if you do not find it, send the answer 401, for example:
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="MY REALM"');
header('HTTP/1.0 401 Unauthorized');
echo 'Please Contact us if you are having problems logging in';
exit;
} else {
$username = trim($_SERVER['PHP_AUTH_USER']);
$password = trim($_SERVER['PHP_AUTH_PW']);
}
/ . , , .