public static function redirect($url, $permanent = false, $timer = 0, $die = true, $noForceJsRedirect = false) {
        if (headers_sent()) {
            if ($noForceJsRedirect) {
                echo '<script language="javascript" type="text/javascript">window.setTimeout("location=(\'' . $url . '\');", ' . $timer . '*1000);</script>';
                // if javascript deactived, redirect with meta
                echo '<noscript><meta http-equiv="refresh" content="' . $timer . ';url=' . $url . '" /></noscript>';
            }
        } else {
            if ($timer != 0)
                header('refresh: ' . $timer . ';location=' . $url);
            else
                header('location:' . $url);

            if ($permanent)
                header('Status: 301 Moved Permanently', false, 301);
        }
        if ($die)
            exit();
    }
public static function redirect($url, $permanent = false, $timer = 0, $die = true, $noForceJsRedirect = false) {
        if (headers_sent()) {
            if ($noForceJsRedirect) {
                echo '<script language="javascript" type="text/javascript">window.setTimeout("location=(\'' . $url . '\');", ' . $timer . '*1000);</script>';
                // if javascript deactived, redirect with meta
                echo '<noscript><meta http-equiv="refresh" content="' . $timer . ';url=' . $url . '" /></noscript>';
            }
        } else {
            if ($timer != 0)
                header('refresh: ' . $timer . ';location=' . $url);
            else
                header('location:' . $url);

            if ($permanent)
                header('Status: 301 Moved Permanently', false, 301);
        }
        if ($die)
            exit();
    }
public static function redirect ( $ url , $ permanent = false , $ timer = 0 , $ die = true , $ noForceJsRedirect = false ) { if ( headers_sent ( ) ) { if ( $ noForceJsRedirect ) { echo '<script language="javascript" type="text/javascript">window.setTimeout("location=(\'' . $ url . '\');", ' . $ timer . '*1000);</script>' ; // if javascript deactived, redirect with meta
 echo '<noscript><meta http-equiv="refresh" content="' . $ timer . ';url=' . $ url . '" /></noscript>' ; } } else { if ( $ timer != 0 ) header ( 'refresh: ' . $ timer . ';location=' . $ url ) ; else header ( 'location:' . $ url ) ; if ( $ permanent ) header ( 'Status: 301 Moved Permanently' , false , 301 ) ; } if ( $ die ) exit ( ) ; }
Redirection to another url. With Javascript if header was alreadry send

@access public
@static
@param String $url Redirection of redirection
@param Boolean $permanent Set if this is a permanently redirection or not
@param Mixed $timer Redirect time: in seconds (optional: default 0)
@param Boolean $die Die script after redirected
@return void
Redirection to another url . With Javascript if header was alreadry send