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

11 lines
304 B
PHP
Raw Normal View History

2021-03-05 12:00:07 +00:00
<?php
$votes = array();
if(isset($_COOKIE["Voting_reg"])) {
$votes = unserialize($_COOKIE["Voting_reg"]);
foreach ($votes as $vote){
if($_POST['gameJamId'] === $vote) return;
}
}
array_push($votes,$_POST['gameJamId']);
setcookie("Voting_reg", serialize($votes), time() + 86400, "/");