Forum Moderators: coopster
I am trying to build a php script, i need a way to store the cookie inside client browser to prevent him dublicating form entry.
so if the cookie still exist, the user will have a message tell him " you cannot do it again untill, one entry perday"
if the user doesn't have cookie, then set a cookie for him/her.
look what i have done
<?php
if (isset($_cookie['user']))
{ echo "you cannot do it again untill, one entry perday";
}
else
{
setcookie("user","bader",time()+86400);
}
?>
i put it at the top of my page, but i got this erorr
Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\d\step1.php:1) in C:\AppServ\www\d\step1.php on line 8.
where is the problem please ?