php.net reference page here:
http://ca3.php.net/manual/en/function.http-redirect.phpI believe this function requires the PECL Class installed, but I could be wrong. Do you know if you have that in place?
also, do you have any other output PRIOR to this call, since it issues Headers and NOTHING can precede the Header in the page output. Even a blank line sent to the HTML page will cause a problem with Headers being sent.
You may require a different function. Here is a sample of a re-direct that I use. It builds the re-derict URL from scratch.
CODE
// Start defining the URL.
$url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']);
// Check for a trailing slash.
if ((substr($url, -1) == '/') OR (substr($url, -1) == '\\') ) {
$url = substr ($url, 0, -1); // Chop off the slash.
}
$url .= '/index.php'; // Add the page. Change the filename to suit.
header("Location: $url");
exit(); // Quit the script.
This was written to redirect within an application. If you need to re-direct to another location on the web, I would suggest another method.
Reply