cookie in

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jacomo
Forum Newbie
Posts: 1
Joined: Mon Mar 10, 2003 1:51 pm
Location: montreal

cookie in

Post by jacomo »

hi,

I want to insert a cookie in php in my page - i included this in a <p> tag - however; it's not working -
where's the pb???
should I split this bunch of code or what???
help pliz...

jr
thx
_______

<?php
$visites=$visites+1;
$secondes=3600*24*366;
$date_fin=time()+$secondes;
setcookie("visites",$visites,$date_fin);
$dejavenu=$visites-1;
if($dejavenu>0);
{
echo"Nous sommes heureux de vous revoir sur notre site";
echo"<P>";
}
else
echo"bonne première visite sur Lynespace";
?>
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

maybe you're using a recent version of php and have to use the array $_COOKIE to access the values.
http://www.php.net/manual/de/function.setcookie.php has some examples how to do that.
Post Reply