ahhhhhhhhhh 🙂
<FORM action="<? if (!$links_target) { print "plbin/set_cookies.php"; }else {print "plbin/reset_cookies.php"; }?>">
reset_cookies.php:
<?php SetCookie ("links_target", "", time()-3600, "/");
SetCookie ("photos_target", "", time()-3600, "/");
header ("Location: http://www.uac.pdx.edu/");
?>
set_cookies.php:
<?php SetCookie ("links_target",$links_target, time()+31536000, "/");
SetCookie ("photos_target",$photos_target, time()+31536000, "/");
Setcookie("firstvisit",Date("d/m/Y"), time()+31536000, "/");
header ("Location: http://www.uac.pdx.edu/");
?>
then you can use something like this for your welcome:
<?php
if ($firstvisit == 1) {
if (isset ($name)) {
print "Welcome back to HHood $name!";
} else {
print "Welcome back to HHood!";
}
} else { print "Welcome Mt. Hood backcountry travelers!";
}
?>
only specify a header redirect for the final else statement. php can process stuff before the header, it's just the header has to be the first line sent to the browser.