Hello all,
i started to make simple poll for my website and i stopped because my srcipt dont want to work
[php]if(isset($_POST[‘poll’])){ //to go inside action if the “Vote button is really clicked”
if(isset ($_COOKIE[“poll”])){ //to see, if the the user before have voted, if the cookie is set, he cant vote again
echo “Error!
Sorry but you can vote more then 1 time !”;
}else{ //if the cookie isnt set, start the action
setcookie(“poll”, “vote”, time()+345600); //set cookie to cant vote again, just after few days!
function plusglas($moment){ //function to add +1, in mysql later
$result = $moment + 1;
return $result;
}
$izglasan = mysql_query(“SELECT * FROM glasanje WHERE Id=’$_POST[poll]’”);// in poll i have something like this and it gets the id of name who is voted
while($row = mysql_fetch_array($izglasan))
{
$konecenrezultat = plusglas($row[‘votes’]); //function made votes + 1
mysql_query(“UPDATE glasanje SET Votes=’$konecenrezultat’ WHERE Id=’$_POST[poll]’”); // update back to the mysql
}
}
}else{
echo “Error!
Sorry but the server wasnt send any informations !”;
}[/php]
My problem is because after i voted, in phpmyadmin the number Votes is same… No changes
can you help me ?