note 59144 modified in function.header by aidan
| From: | aidan@php.net | Date: | Wed, 21 Dec 2005 07:11:46 +0000 |
| Subject: | note 59144 modified in function.header by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-100505@lists.php.net to get a copy of this message | ||
I have a function to redirect a page allways using header or javascript when headers_sent() == true.
<?php
function Redirect($url) {
if(headers_sent()) {
echo "<script
type='text/javascript'>location.href='$url';</script>";
} else {
header("Location: $url");
}
}
?>
--was--
I have a function to redirect a page allways using header or javascript when headers_sent() == true.
function Redirect($url) {
if(headers_sent()) {
echo "<script
type='text/javascript'>location.href='$url';</script>";
} else {
header("Location: $url");
}
}
http://php.net/manual/en/function.header.php