if(mysql_num_rows($validate_voter)>0)
{
$msg1 = 1; //msg1: 1=Cheater, 2=Not cheater
$msg2 = 2; //msg2: 1=Display, 2=Don't Display
header("Location: http:" . $filename . "?" . $php_query . "&pollreq=" . $poll_results_page . "&msg1=" . $msg1 . "&msg2=" . $msg2 . "#poll");
}
if(!isset($_COOKIE["r3nPoll"]))
{
$msg1 = 1; //msg1: 1=Cheater, 2=Not cheater
$msg2 = 2; //msg2: 1=Display, 2=Don't Display
header("Location: http:" . $filename . "?" . $php_query . "&pollreq=" . $poll_results_page . "&msg1=" . $msg1 . "&msg2=" . $msg2 . "#poll");
}
else
{
$msg1 = 2; //msg1: 1=Cheater, 2=Not cheater
$msg2 = 2; //msg2: 1=Display, 2=Don't Display
// Updates vote count number (adds 1)
mysql_query("update $poll_data set optionCount=optionCount +1 where pollID=$pollID and voteID=$voteID") or die (mysql_error());
// Updates vote count number TOTAL (adds 1)
mysql_query("update $poll_data set optionTotal=optionTotal +1 where pollID=$pollID") or die (mysql_error());
// Updates IP info for anti-cheat
mysql_query("insert $poll_log set votersIP='$REMOTE_ADDR', timestamp=now(), pollID=$pollID, voteID=$voteID") or die (mysql_error());
$cookie_value = 'Voted for option ' . $voteID;
$cookie_expire_time = time() + 15768000; // valid for one year
$cookie_path = '/';
setcookie ('r3nPoll' , $cookie_value , $cookie_expire_time , $cookie_path);
header("Location: http:" . $filename . "?" . $php_query . "&pollreq=" . $poll_results_page . "&msg1=" . $msg1 . "&msg2=" . $msg2 . "#poll");
}
This is basicaly what i have at the moment - but putting the ! before isset makes the script thing the user HAS a cookie when they dont.
I need a way to stop the script from doing this, without loosing the ! -- or even if theres a way to replace the ! with something else....