Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
24 righe
556 B
PHP
24 righe
556 B
PHP
<?php
|
|
|
|
require_once __DIR__ . "/required.php";
|
|
|
|
$qid = $VARS['qid'];
|
|
$aid = $VARS['aid'];
|
|
|
|
$code = $database->get('questions', 'qcode', ['qid' => $qid]);
|
|
|
|
if (!$database->has('answers', ["AND" => ['qid' => $qid, 'aid' => $aid]])) {
|
|
header("Location: ./r/$code/error");
|
|
die();
|
|
}
|
|
|
|
if ($_SESSION['voted'][$qid] === true) {
|
|
header("Location: ./r/$code/dejavu");
|
|
die();
|
|
}
|
|
|
|
$database->insert("responses", ['qid' => $qid, 'aid' => $aid, 'timestamp' => date('Y-m-d H:i:s')]);
|
|
|
|
$_SESSION['voted'][$qid] = true;
|
|
|
|
header("Location: ./r/$code/thanks"); |