Right off the top of my head, you have three options that I can see:

(1) Rewrite the code to avoid any output before the redirect.

(2) Use output buffering (available only in PHP4). I haven't used 
this, but check out

        http://www.php.net/manual/en/ref.outcontrol.php

(3) Use a META REFRESH tag. For example:

        <META HTTP-EQUIV="refresh" CONTENT="1;page.php">

where 1 is the time (in seconds) before you want the redirect, and 
'page.php' is where you want the redirect to. Of course, this tag 
needs to be in the <HEAD> section, so it might not help you much.

As far as I know, though, cold fusion's <cflocation> tag only works 
because CF does output buffering implicitly. So, I'd guess you need 
to do option (2).

        -steve



At 10:37 AM -0400 9/10/01, Andrew Penniman wrote:
>I am trying to figure out how to use PHP to redirect the user to a new
>location *after* processing and most likely outputting a bunch of code.
>Because this redirection would happen late in the game I can't use
>header("Location: ".$redirect_to);
>
>I come from a ColdFusion background and am used to CFAS' <cflocation>
>tag.  Does PHP have an equivalent function?
>
>I am really hoping not to use JavaScript, I want this redirection to
>happen at the server and not the client.


-- 
+------------------------ Open source questions? ------------------------+
| Steve Edberg                           University of California, Davis |
| [EMAIL PROTECTED]                               Computer Consultant |
| http://aesric.ucdavis.edu/                  http://pgfsun.ucdavis.edu/ |
+----------- http://pgfsun.ucdavis.edu/open-source-tools.html -----------+

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to