index.php 962 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. #=========================================================================================
  14. # Generic XHTML 1.1 header
  15. print <<<ENDOLA
  16. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  17. "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  18. <html xmlns="http://www.w3.org/1999/xhtml">
  19. <head>
  20. <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
  21. <title>UberZach TV</title>
  22. </head>
  23. <body>
  24. ENDOLA;
  25. if ($show === false) {
  26. printAllShows();
  27. } else {
  28. printShow($show);
  29. }
  30. # Generic XHTML 1.1 footer
  31. print <<<ENDOLA
  32. </body>
  33. </html>
  34. ENDOLA;
  35. ?>