<?
require('dbconection.php');
$id_cat = $_POST['id_cat'];
//CHECK DE COOKIES:
function check_cookie(){
if (isset($_COOKIE["donacuario"])){ //REVISA SI EXISTE LA COOKIE
return $_COOKIE["donacuario"];
}
else //CREAR LA COOKIE
{
session_start();
setcookie("donacuario",session_id(),time() + 3600);
return session_id();
}
}
$ses = check_cookie();
if ( $ses != "" ){
$fecha = date("F j, Y, g:i a");
$ingresa_prod = mysql_query("INSERT INTO don_carrito_temp VALUES('$ses','$id_producto','$cantidad','$fecha')");
//echo "$ses";
header ("LOCATION: index.php?id_cat=$id_cat");
}
?>
I have this error:
Warning: Cannot add header information - headers already sent by (output started at add_carrito.php:23) in add_carrito.php on line 24
Any ideas... ?