Game-Jaming/Backend/Controllers/Polls/VoteChecking.php

11 lines
301 B
PHP

<?php
$votes = array();
if(isset($_COOKIE["votingReg"])) {
$votes = unserialize($_COOKIE["votingReg"]);
foreach ($votes as $vote){
if($_POST['gameJamId'] === $vote) return;
}
}
array_push($votes,$_POST['gameJamId']);
setcookie("VotingReg", serialize($votes), time() + 86400, "/");