I am not sure if I am posting the right data, but here is an excert of 1) functions.inc.php and 2) poll.php:
1)
// cookie check
if (isset($tapps_cookie) && $tapps_cookie==TRUE)
{
if (in_array($poll_id, $already_voted))
{
die("You have already voted.<br>\n");
}
}
1)
// cookie
if (isset($tapps_cookie) && $tapps_cookie==TRUE)
{
array_push($already_voted, $poll_id);
$cookie_value = serialize($already_voted);
setcookie("$tapps_cookie_name","$cookie_value",time()+31536000);
// if we force the user to accpet the cookie then create a pending vote
// and redirect to that url
if (isset($tapps_cookie_force) && $tapps_cookie_force==TRUE)
{
$db_value = serialize($options);
$id = md5(uniqid(rand()));
db_query("INSERT INTO tapps_pending (id,poll_id,options) VALUES('$id',$poll_id,'$db_value')");
$url = "http://".$HTTP_SERVER_VARS['HTTP_HOST'].$HTTP_SERVER_VARS['PHP_SELF']."?mode=activate&pending_id=$id";
// don't redirect now if we have email confirmation enabled (handled later)
if (isset($tapps_email_confirmation)==FALSE || $tapps_email_confirmation!=TRUE ||
isset($voter_email)==FALSE || $voter_email == "")
{
header("Location: $url");
echo "<html><body></body></html>";
exit;
}
}
2)
// verify cookie data
if (isset($tapps_cookie) && $tapps_cookie==TRUE)
{
$already_voted = array();
if (isset($HTTP_COOKIE_VARS["$tapps_cookie_name"]))
{
$already_voted = unserialize(stripslashes($HTTP_COOKIE_VARS["$tapps_cookie_name"]));
if (is_array($already_voted) == FALSE)
{
die("Invalid cookie data.<br>(Don't mess with the input. I don't trust you!)<br>\n");
}
foreach ($already_voted as $option_id)
{
if (is_numeric($option_id) == FALSE)
{
die("Invalid cookie data.<br>(Don't mess with the input. I don't trust you!)<br>\n");
}
$option_id = (int)$option_id;
}
}
}
Thank you for trying to help me.