Hi ! I have written a Cookie code , but I am getting an error . I want the cookie to store some data and date to be renewd every time the user visits my site
[CODE]
?php
//Creating cookies
if(isset($_COOKIE[“visit”])) {
$visit_count = $_COOKIE[‘visit’];
setcookie (“visit”, ++$visit_count, date()+(60*60*24*365));
echo “Number of Visits”;
echo ($_COOKIE[‘visit’]) +1;
}else{
setcookie (“visit”, time(), time()+(60*60*24*365));
}
?>
The Output is as below ,
Warning: date() expects at least 1 parameter, 0 given in C:xampphtdocstrialcook.php on line 5
Warning: Cannot modify header information – headers already sent by (output started at C:xampphtdocstrialcook.php:5) in C:xampphtdocstrialcook.php on line 5
Number of Visits1228008728