error.php 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. error_log("ERROR " . http_response_code());
  3. return;
  4. session_start();
  5. $http_host = $_SERVER["HTTP_HOST"];
  6. $doc_root = $_SERVER["DOCUMENT_ROOT"] . "/";
  7. include $doc_root . "functions.php";
  8. $proto = get_protocol();
  9. $con = start_db();
  10. $server = $proto . $http_host;
  11. $lang = select_language($con);
  12. $lserver = $server . "/" . $lang;
  13. $cur_section = "error";
  14. $cur_entry = http_response_code();
  15. stats($con, $cur_section, $cur_entry);
  16. $error = $cur_entry;
  17. if (!in-array($error, array("400", "401", "403", "404", "500"))){
  18. $error = "XXX";
  19. }
  20. ?>
  21. <!DOCTYPE html>
  22. <html>
  23. <head>
  24. <meta content='text/html; charset=windows-1252' http-equiv='content-type'/>
  25. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'>
  26. <title><?=text($con, "ERROR_TITLE", $lang);?> - <?=text($con, "USER_NAME", $lang);?></title>
  27. <link rel='shortcut icon' href='<?=$lserver?>/img/logo/favicon.ico'>
  28. <!-- CSS files -->
  29. <style>
  30. <?php
  31. include $doc_root . "css/ui.css";
  32. include $doc_root . "css/error.css";
  33. ?>
  34. </style>
  35. <!-- CSS for mobile version -->
  36. <style media="(max-width : 990px)">
  37. <?php
  38. include $doc_root . "css/m/ui.css";
  39. include $doc_root . "css/m/error.css";
  40. ?>
  41. </style>
  42. <meta name="robots" content="noindex follow"/>
  43. </head>
  44. <body>
  45. <div id='body'>
  46. <div id='body_row'>
  47. <div id='left'>
  48. <div id='logo'>
  49. <img id='logo' src='<?=$lserver?>/img/logo/x6/inigovalentin.png' alt='<?=text($con, "USER_NAME", $lang);?>'/>
  50. </div>
  51. <table id='error_code' class='entry'>
  52. <tr>
  53. <td id='error_number'>
  54. 404
  55. </td>
  56. <td id='error_tag'>
  57. <?=text($con, "ERROR_ERROR", $lang);?>
  58. <br/>
  59. <?=text($con, "ERROR_CODE", $lang);?>
  60. </td>
  61. <tr>
  62. </table>
  63. <?php
  64. include $doc_root . "footer.php";
  65. ?>
  66. </div> <!-- left -->
  67. <div id='right'>
  68. <div id='error_message' class='entry'>
  69. <?=text($con, "ERROR_" . $error . "_DESCRIPTION", $lang);?>
  70. <br/><br/>
  71. <?=text($con, "ERROR_" . $error . "_SOLUTION", $lang);?>
  72. <ul>
  73. <li>
  74. <a href='javascript: location.reload();'><?=text($con, "ERROR_" . $error . "_SOLUTION_0", $lang);?></a>
  75. </li>
  76. <li>
  77. <a href='javascript: history.go(-1);'><?=text($con, "ERROR_" . $error . "_SOLUTION_1", $lang);?></a>
  78. </li>
  79. <li>
  80. <a href='<?=$lserver?>/'><?=text($con, "ERROR_" . $error . "_SOLUTION_2", $lang);?></a>
  81. </li>
  82. </ul>
  83. </div> <!-- #error_message -->
  84. </div>
  85. </div> <!-- #body_row -->
  86. </div> <!-- #body -->
  87. </body>
  88. </html>
  89. <?php
  90. http_response_code($cur_entry);
  91. ?>