?? cookies ??

kaits

Mitglied
Hi

I made a rating system and I want also allow voting for non registered users, but how do I set a cookie for every picture they're voting for?

@setcookie('voting',$asd[0],time()+36000);

$asd[0] is the ID of the picture you are voting for, but so the cookie is being overwritten every time you vote :(

I need to set a cookie for every picture


feel free to answer in German ;)
 
U must give each cookie an other name:
To set the cookie try this:

Code:
$n = 0;
while($_COOKIE['voting'.$n])
{
$n++;
}
@setcookie('voting'.$n,$asd[0],time()+36000);

the cookiename will be 'votingsN'(N=Indexnumber)
to get the variable, you have to work with eval()...
 
Zurück