[ Index ]

PHP Cross Reference of E107 v0.7.22 code documentation

title

Body

[close]

/ -> error.php (source)

   1  <?php
   2  /*
   3  + ----------------------------------------------------------------------------+
   4  |     e107 website system
   5  |
   6  |     ©Steve Dunstan 2001-2002
   7  |     http://e107.org
   8  |     jalist@e107.org
   9  |
  10  |     Released under the terms and conditions of the
  11  |     GNU General Public License (http://gnu.org).
  12  |
  13  |     $Source: /cvs_backup/e107_0.7/error.php,v $
  14  |     $Revision: 11346 $
  15  |     $Date: 2010-02-17 13:56:14 -0500 (Wed, 17 Feb 2010) $
  16  |     $Author: secretr $
  17  +----------------------------------------------------------------------------+
  18  */
  19  
  20  
  21  
  22  define("ERR_PAGE_ACTIVE",'error');
  23  
  24  require_once ("class2.php");
  25  
  26  if (!defined('PAGE_NAME')) define('PAGE_NAME','Unknown page');
  27  $errorHeader = '';
  28  $errorText = '';
  29  $errorNumber = 999;
  30  $errFrom = $_SERVER['HTTP_REFERER'];
  31  $errTo = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
  32  $errorQuery = htmlentities($_SERVER['QUERY_STRING']);
  33  $base_path = e_HTTP;
  34  if (is_numeric(e_QUERY)) $errorNumber = e_QUERY;
  35  
  36  switch($errorNumber) 
  37  {
  38    case 400 :
  39      $errorHeader = "HTTP/1.1 400 Bad Request";
  40      $errorText = "<div class='installe'><img src='".e_IMAGE_ABS."icons/icon3.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_35."</div><br /><div class='installh'>".LAN_ERROR_36."</div><br /><div class='smalltext'>".LAN_ERROR_3."</div>
  41          <br /><div class='installh'>".LAN_ERROR_2."<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
  42      break;
  43    case 401:
  44      header("HTTP/1.1 401 Unauthorized");
  45      $errorText = "<div class='installe'><img src='".e_IMAGE_ABS."icons/icon3.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_1."</div><br /><div class='installh'>".LAN_ERROR_2."</div><br /><div class='smalltext'>".LAN_ERROR_3."</div>
  46          <br /><div class='installh'>".LAN_ERROR_2."<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
  47      break;
  48    case 403:
  49      header("HTTP/1.1 403 Forbidden");
  50      $errorText = "<div class='installe'><img src='".e_IMAGE_ABS."icons/icon3.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_4."</div><br /><div class='installh'>".LAN_ERROR_5."</div><br /><div class='smalltext'>".LAN_ERROR_6."</div>
  51          <br /><div class='installh'>".LAN_ERROR_2."<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
  52      break;
  53    case 404:
  54      header("HTTP/1.1 404 Not Found");
  55      $errorText = "<h3><img src='".e_IMAGE_ABS."icons/icon3.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_7."</h3><br />".LAN_ERROR_21."<br /><br />".LAN_ERROR_23."<b>{$errTo}</b>".LAN_ERROR_24."<br /><br />";
  56  
  57      if (strlen($errFrom)) $text .= LAN_ERROR_9." ( <a href='{$errFrom}' rel='external'>{$errFrom}</a> ) -- ".LAN_ERROR_19."<br />";
  58  
  59  
  60      $errorText .= "<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a><br />";
  61      $errorText .= "<a href='{$base_path}search.php'>".LAN_ERROR_22."</a>";
  62      break;
  63    case 500:
  64      header("HTTP/1.1 500 Internal Server Error");
  65      $errorText = "<div class='installe'><img src='".e_IMAGE_ABS."icons/icon3.png' alt='".LAN_ERROR_37."' /> ".LAN_ERROR_10."</div><br /><div class='installh'>".LAN_ERROR_11."</div><br /><div class='smalltext'>".LAN_ERROR_12."</div>
  66          <br /><div class='installh'>".LAN_ERROR_2."<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
  67      break;
  68    case 999:
  69      if (E107_DEBUG_LEVEL)
  70      {
  71        echo LAN_ERROR_33."<br/><pre>\n";
  72        print_r($_SERVER);
  73        print_r($_REQUEST);
  74        echo "\n</pre>\n";
  75      }
  76      else
  77      {
  78          header("location: ".e_HTTP."index.php");
  79          exit;
  80      }
  81      break;
  82    default :
  83      $errorText = "<div class='installe'>".LAN_ERROR_13." (".$errorQuery.")</div><br /><div class='installh'>".LAN_ERROR_14."</div><br /><div class='smalltext'>".LAN_ERROR_15."</div>
  84          <br /><div class='installh'><a href='{$base_path}index.php'>".LAN_ERROR_20."</a></div>";
  85  /*
  86    default:
  87      $errorText = LAN_ERROR_34." e_QUERY = '".e_QUERY."'<br /><a href='{$base_path}index.php'>".LAN_ERROR_20."</a>";
  88      break; */
  89  }
  90  
  91  if ($errorHeader) header($errorHeader);
  92  
  93  require_once(HEADERF);
  94  
  95  $ns->tablerender(PAGE_NAME, $errorText);
  96  require_once(FOOTERF);
  97  ?>


Generated: Tue Aug 3 00:19:13 2010
Open Source related documentation for developers.