Non capisco perche nn mi salva i cookie:
mi da questo errore:
Notice: Undefined index: visit_page_mateseventi
PHP:
require_once "inc/entityhtml.php";
require_once "inc/db.php";
$cat=trim($_GET["cat"]);
$art=trim($_GET["art"]);
$title=decode($art)." — MatesEventi";
$db=new database;
$db->connect();
$ip=trim($_SERVER['REMOTE_ADDR']);
if(!isset($_COOKIE["visit_page_mateseventi"])){
$sql="UPDATE archive SET Visite=Visite + 1 WHERE Titolo='$art' AND Comune='$cat' OR Tipologia='$cat'";
if(!$db->query($sql)){
$time=mktime(23, 59, 59, date("m"), date("d"), date("Y"));
if(!setcookie("visit_page_mateseventi",$ip,time())) echo "errore cookie";
}
$sql="";
}
echo "IP: ".$_COOKIE["visit_page_mateseventi"];
mi da questo errore:
Notice: Undefined index: visit_page_mateseventi