Ejemplo n.º 1
0
 /**
  * Perform an HTTP redirect
  * @param string $url url to redirect to
  * @param int $status current HTTP status
  * @return void
  */
 public static function page_redirect($url, $status = false)
 {
     if (DEBUG_MODE) {
         Hm_Debug::add(sprintf('Redirecting to %s', $url));
         Hm_Debug::load_page_stats();
         Hm_Debug::show('log');
     }
     if ($status == 303) {
         Hm_Debug::add('Redirect loop found');
         Hm_Functions::cease('Redirect loop discovered');
     }
     Hm_Functions::header('HTTP/1.1 303 Found');
     Hm_Functions::header('Location: ' . $url);
     return Hm_Functions::cease();
 }
Ejemplo n.º 2
0
 /**
  * Send HTTP headers
  * @param array $headers headers to send
  * @return void
  */
 protected function output_headers($headers)
 {
     foreach ($headers as $header) {
         Hm_Functions::header($header);
     }
 }