and still dosent stop me from vote as much as I want to. But the cookie will be written. What I want to do is.
1. If no cookie, make one with no vote
2. If cookie with no vote, allow vote
3. If cookie with vote, dont allow vote
this is my script, you can reda the $rostat as "$i_have_voted" for yourself to get a clear picture.
if(empty($rostat))
{
$rostat=nej;
setcookie("pollcookie", $rostat, time()+3600*1000, "http://localhost/mysqltestar/");
}
if($radiopoll==1)
{
if($rostat=="nej")
{
mysql_query("UPDATE polli SET ja=ja+1");
$rostat="ja";
setcookie("pollcookie", $rostat, time()+3600*1000, "http://localhost/mysqltestar/");
}
}
if($radiopoll==2)
{
if($rostat=="nej")
{
mysql_query("UPDATE polli SET nej=nej+1");
$rostat="ja";
setcookie("pollcookie", $rostat, time()+3600*1000, "http://localhost/mysqltestar/");
}
}
The problem is that after the first vote $rostat will be changed to "ja" but the if($rostat=="nej") dosent work at all and ist just a simple if... i dont get it.
cheers knuff