Tengo un código el cual me permite autentificar en ciertas páginas. Es muy parecido al que aparece en la sección de FAQ. Funciona perfectamente excepto cuando le pongo lo siguiente para poder "salir":
Código PHP:
if ($_REQUEST['logout']==true) {
login();
}
Warning: Cannot add header information - headers already sent by (output started at /var/www/porra/admin.php:7) in /var/www/porra/security.php on line 14
Warning: Cannot add header information - headers already sent by (output started at /var/www/porra/admin.php:7) in /var/www/porra/security.php on line 15
Las líneas 14 y 15 del security.php que me alerta son éstas:
Código PHP:
header('WWW-Authenticate: Basic realm="sitio.com"');
header('HTTP/1.1 401 Unauthorized');
Gracias de antemano :)