I'm using the PHP Header function to redirect to another page after doing some checks, but the redirect isn't working correctly, it just refreshed to an almost completely blank page of the same name (it includes and <link> and <script> in <head>, <body is empty). My redirect function looks like these (I've tried all of them):
I've put all of these attempts at the very top of the page and have tried them on different pages. Also, another thing to note is that all these of these work on another host as well as my own personal one.
Once last note, while the function is declared at the top, it's actually called from further in. I wasn't sure if this was important as it has worked for me as is on other hosts.
PHP:
<?PHP function redirect($url){header("location: ".$url); exit;} session_start();?> //$url = index.php
<?PHP function redirect(){header("location: http:\\www.google.com"); exit;} session_start();?>
<?PHP function redirect(){header("location: http:\\www.*myOwnSite*.ca"); exit;} session_start();?> //*myOwnSite* is actually something else, but it's still my own site hosted elsewhere.
Once last note, while the function is declared at the top, it's actually called from further in. I wasn't sure if this was important as it has worked for me as is on other hosts.
Last edited: