index.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?
  2. # Include the TV functions
  3. require_once 'includes/main.php';
  4. # Send our headers early
  5. header('Content-type: text/html; charset=utf-8');
  6. # Did the user request a specific show?
  7. $show = false;
  8. if (isset($_REQUEST['show'])) {
  9. # This is not a great filter, but it should make the string safe for use as a quoted path
  10. $show = preg_replace('/[\0\n\r]/', '', $_REQUEST['show']);
  11. $show = basename($show);
  12. }
  13. # Did the user request an update?
  14. if ($show !== false && isset($_POST['Save'])) {
  15. echo '<h4 style="color: red;">Saving not yet implemented</h4>';
  16. #saveFlags($show, $_POST);
  17. saveSeasons($show, $_POST);
  18. }
  19. #=========================================================================================
  20. # Generic XHTML 1.1 header
  21. print <<<ENDOLA
  22. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  23. "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  24. <html xmlns="http://www.w3.org/1999/xhtml">
  25. <head>
  26. <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
  27. <title>UberZach TV</title>
  28. </head>
  29. <body>
  30. ENDOLA;
  31. if ($show === false) {
  32. printAllShows();
  33. } else {
  34. printShow($show);
  35. }
  36. # Generic XHTML 1.1 footer
  37. print <<<ENDOLA
  38. </body>
  39. </html>
  40. ENDOLA;
  41. ?>