diff --git a/index.html b/index.html deleted file mode 100644 index f1a03e8..0000000 --- a/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - Weh? - - - - - - - - -
-

Weh?

-
- -
- - - diff --git a/weh.php b/weh.php index 9a76df9..1d87cc6 100644 --- a/weh.php +++ b/weh.php @@ -2,7 +2,12 @@ $quotes = file_get_contents('weh.json'); if ($quotes !== false) { $quotes = json_decode($quotes, true); - $quote = $quotes[array_rand($quotes)]; + if (isset($_GET['idx']) && ctype_digit($_GET['idx']) && $_GET['idx'] < count($quotes)) { + $index = $_GET['idx']; + } else { + $index = array_rand($quotes); + } + $quote = $quotes[$index]; } ?>