A simple system for creating multiple-choice questions for an audience to answer on their phones. Responses are tallied and displayed in real-time. https://openquestion.netsyms.com

index.php 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. require_once __DIR__ . "/required.php";
  3. ?>
  4. <!DOCTYPE html>
  5. <meta charset="UTF-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  7. <title><?php echo SITE_TITLE; ?></title>
  8. <link rel="stylesheet" href="<?php echo SITE_PATH; ?>css/bootstrap.min.css" />
  9. <link rel="stylesheet" href="<?php echo SITE_PATH; ?>css/fa-svg-with-js.css" />
  10. <script nonce="<?php echo $SECURE_NONCE; ?>">
  11. FontAwesomeConfig = {autoAddCss: false}
  12. </script>
  13. <script defer src="<?php echo SITE_PATH; ?>js/fontawesome-all.min.js"></script>
  14. <script src="<?php echo SITE_PATH; ?>js/jquery-3.3.1.min.js"></script>
  15. <script src="<?php echo SITE_PATH; ?>js/bootstrap.min.js"></script>
  16. <?php
  17. $path = $_SERVER['REQUEST_URI'];
  18. $pos = strpos($_SERVER['REQUEST_URI'], SITE_PATH);
  19. if ($pos !== false) {
  20. $path = substr_replace($_SERVER['REQUEST_URI'], "", $pos, strlen(SITE_PATH));
  21. }
  22. $pathbits = explode("/", $path);
  23. $pageid = $pathbits[0];
  24. $arg1 = isset($pathbits[1]) ? $pathbits[1] : "";
  25. $arg2 = isset($pathbits[2]) ? $pathbits[2] : "";
  26. switch ($pageid) {
  27. case "":
  28. require __DIR__ . "/pages/home.php";
  29. break;
  30. case "create":
  31. require __DIR__ . "/pages/create.php";
  32. break;
  33. case "q":
  34. require __DIR__ . "/pages/question.php";
  35. break;
  36. case "r":
  37. case "respond":
  38. require __DIR__ . "/pages/respond.php";
  39. break;
  40. default:
  41. require __DIR__ . "/pages/404.php";
  42. break;
  43. }
  44. ?>