Last Updated: February 25, 2016
·
468
· brendanmurty

Redirect

Redirect the user using the most suitable method.

<?
function redirect($url){
if(headers_sent()){
    print '&lt;script&gt;window.location="'.$url.'"&lt;/script&gt;';
}else{
    header('Location: '.$url);
}
exit();
}
?>