<?php
$username = 'root';
$userpass = '12345';
if (!isset($_SERVER['PHP_AUTH_USER'])
or !isset($_SERVER['PHP_AUTH_PW'])
or ($_SERVER['PHP_AUTH_USER'] != $username)
or ($_SERVER['PHP_AUTH_PW'] != $userpass))
{
Header ("WWW-Authenticate: Basic realm=\'Admin Panel\'");
Header ("HTTP/1.0 401 Unauthorized");
exit ('Хакер? Ха Ха');
}
?>
так подрубаю к странице админской части
<?php include('blocks/authorize.php'); ?>
в хроме работает нормально, а в интернет эксплорер и опере выдает ошибку
Warning: Cannot modify header information - headers already sent by (output started at Z:\home\1-afisha-rest.ru\www\admin\index.php:1) in Z:\home\1-afisha-rest.ru\www\admin\blocks\authorize.php on line 9
Warning: Cannot modify header information - headers already sent by (output started at Z:\home\1-afisha-rest.ru\www\admin\index.php:1) in Z:\home\1-afisha-rest.ru\www\admin\blocks\authorize.php on line 10
Хакер? Ха Ха
типа заголовки отправлены поезд ушел... в чем может быть проблема?