if (test){ ---do something--- $URL="http://yourwebsite.com/"; echo '<META HTTP-EQUIV="refresh" content="0;URL=' . $URL . '">'; echo "<script type='text/javascript'>document.location.href='{$URL}';</script>"; } else { return false; }
If you're wondering why I used the Meta tag and JavaScript to redirect , then the answer is very simple.
If JavaScript is disabled in the browser, the meta tag redirects the page.
source share