tengo el siguiente codigo
<?php
if (($_SERVER['PHP_AUTH_USER']=="administrador") &&
($_SERVER['PHP_AUTH_PW']=="casa")) {
Aca la pagina si la autentificacion dio bien...
} else {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
echo 'Debe loguearse para poder ingresar';
exit;
}
?>
pero me da el siguiente error
Notice: Undefined index: PHP_AUTH_USER in /cuentas/santotomeonline/www/galerias/index.php on line 2
Warning: Cannot modify header information - headers already sent by (output started at /cuentas/santotomeonline/www/galerias/index.php:2) in /cuentas/santotomeonline/www/galerias/index.php on line 161
Warning: Cannot modify header information - headers already sent by (output started at /cuentas/santotomeonline/www/galerias/index.php:2) in /cuentas/santotomeonline/www/galerias/index.php on line 162
Debe loguearse para poder ingresar
cuando pongo display_errors = Off
en php.ini
anda perfecto
que puede ser?
gracias
Federico