getMessage().'"'); } if (!$api->isAuthenticated(false, true)) { quit('You need to be logged in to create a new poll!'); } if (!empty($_POST['submit'])) { $prompt = $_POST['prompt']; $options = $_POST['option']; $is_anonymous = !empty($_POST['anonymous']); $is_public = !empty($_POST['public']); $max_options = (int)$_POST['max_options']; $duration_days = (int)$_POST['duration_days']; $duration_hours = (int)$_POST['duration_hours']; $duration_minutes = (int)$_POST['duration_minutes']; $duration_total_minutes = $duration_days*60*24 + $duration_hours * 60 + $duration_minutes; try { $poll = Poll::create($api, $prompt, $options, $max_options, $duration_total_minutes, $is_anonymous, $is_public); redirect('post_poll.php?poll_token='.$poll->token.'&id='.$poll->id); } catch (\Exception $e) { quit('Something went wrong creating the poll: "' . $e->getMessage() . '"'); } } ?>
maxlength="64"/>
day(s) hour(s) minute(s)