I am trying to set a cookie at the time the visitor hits the page so we can display what is new since they were last there...
Here is what I have...
<? // Do we have an Agent
if (!isset($_COOKIE['id'])) {
header ("Location: [url]http://[/url]".$_SERVER['HTTP_HOST']."/corporate/consultant.php");
}
// Today's date numerical values
$Today = date("Y-m-d");
// Today's date in word values
$Date = date("l, d F Y");
// Server time on page load. Server Time is consistent with CST
$ServerTime = date("H:i");
// Calgary Time on page load
$HourDiff = "1"; // Behind CST
$TimeAdjust = ($HourDiff *60 *60);
$LocalTime = date("H:i", time()-$TimeAdjust); // We need to subtract Time Adjust because MST is one hour behind CST
// Do we have A Last Visted Cookie
if (!isset($_COOKIE['visit' ])) {
setcookie ('visit', $Today);
}
?>
There is some more stuff here - but not pertinent to this issue...
Then by each item I have this..
<?php // Set NEW based on VISIT
if($row_NewsHeadlines['date'] == ($_COOKIE['visit'])) {
print ("<span class=\"new\">New </span>- ");
}
?>
However when you hit the page I get the error that visit has not been defined...
What do I need to do?