/** * 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(); }
/** * Send HTTP headers * @param array $headers headers to send * @return void */ protected function output_headers($headers) { foreach ($headers as $header) { Hm_Functions::header($header); } }