From: Chris Fulljames Date: Sat, 30 May 2026 14:18:22 +0000 (-0400) Subject: Add images, general fixes X-Git-Url: https://littlesong.place/gitweb/?a=commitdiff_plain;h=1311de6aa6faa0862bc577d2df2c5e1905e722df;p=poll.git Add images, general fixes --- diff --git a/bot.png b/bot.png new file mode 100644 index 0000000..8ae55d9 Binary files /dev/null and b/bot.png differ diff --git a/drag.png b/drag.png new file mode 100644 index 0000000..85ae8ad Binary files /dev/null and b/drag.png differ diff --git a/fave.png b/fave.png new file mode 100644 index 0000000..794507a Binary files /dev/null and b/fave.png differ diff --git a/index.php b/index.php index 0cb3a07..e201106 100644 --- a/index.php +++ b/index.php @@ -17,6 +17,14 @@ function query_db($query, $params=null) return $statement; } +function qid_exists($qid) +{ + $q = query_db( + "SELECT * FROM questions WHERE qid = ?", + [ $qid ])->fetch(); + return (bool) $q; +} + function get_title($qid) { $q = query_db( @@ -124,6 +132,13 @@ if (isset($_POST['title']) and isset($_POST['options'])) exit; } +if (isset($qid) && !qid_exists($qid)) +{ + // Invalid question ID - redirect to new question + header("Location: /"); + exit; +} + $ended = false; if (isset($qid)) { @@ -180,13 +195,17 @@ if (isset($qid) && isset($_GET['count'])) { Poll!