getMessage().'"' . get_page_footer()); } if (!$api->isAuthenticated(false, true)) { die('You need to be logged in to create a new poll!' . get_page_footer()); } 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.'&prompt='.urlencode($prompt)); } catch (\Exception $e) { die('Something went wrong creating the poll: "' . $e->getMessage() . '"' . get_page_footer()); } } ?>
maxlength="64"/>
day(s) hour(s) minute(s)