control.php
Código PHP:
<?php
session_start();
if ($_SESSION["autentificat"] == "SI")
{
}
else
{
header("Location: ../index.php");
}
?>
Luego por ejemplo en uno hay este codigo para borrar un producto:
borrar_prod.php
Código PHP:
<?php
session_start();
include("../Connections/connexio.php");
include("../control.php");
$id = $_POST["id"];
$del = "DELETE FROM productes WHERE id='$id' ";
mysql_query($del);
header("Location: ../manteniment_prod/prod_baixa.php");
?>
Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\PFC\control.php:41) in C:\AppServ\www\PFC\manteniment_prod\borrar_prod.ph p
Ya se que es pq antes de un header no puede haber ningun 'output', ninguna salida. Pero no entiendo pq me da el warning y no redirecciona si en el control.php solo entra en el header en caso de haberse identificado mal.
Me podeis ayudar?? ;)