In ASP,I can write "response.redirect URL" to redirect to a URL.How to do it in PHP?
How to write redirection sentence in PHP?
header ('Location: the page you want')
This is all you need to do for one way to redirect. Hope this help you out
This is all you need to do for one way to redirect. Hope this help you out
| Code: |
| function redirect($filename) {
if (!headers_sent()) header('Location: '.$filename); else { echo '<script type="text/javascript">'; echo 'window.location.href="'.$filename.'";'; echo '</script>'; echo '<noscript>'; echo '<meta http-equiv="refresh" content="0;url='.$filename.'" />'; echo '</noscript>'; } } |
Usage -
| Code: |
| redirect("http://www.google.com"); |
| Aelita wrote: |
| header ('Location: the page you want')
This is all you need to do for one way to redirect. Hope this help you out |
| n0obie4life wrote: | ||||
Usage -
|
