Redirect
Redirect the user using the most suitable method.
<?
function redirect($url){
if(headers_sent()){
    print '<script>window.location="'.$url.'"</script>';
}else{
    header('Location: '.$url);
}
exit();
}
?>Written by Brendan Murty
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
 #Javascript 
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#

 
 
 
