Re: Redirects in PHP
| From: | Kevin Stone | Date: | Fri, 13 Jun 2003 17:07:35 +0000 |
| Subject: | Re: Redirects in PHP | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-151380@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: "Zak Johnson" <zakj-php-general@nox.cx>
To: <php-general@lists.php.net>
Sent: Friday, June 13, 2003 11:00 AM
Subject: Re: [PHP] Redirects in PHP
> On 2003-06-13 10:54-0600, Kevin Stone wrote:
> > Carl, you can avoid these issues by using output buffering allowing you
to
> > call header() whever you want in your script.
>
> This will not solve the OP's problem; the header will still be output
> first, and the client will be immediately redirected. I am curious
> though; why is everyone suggesting to use JavaScript when the following
> in the <head> section of the HTML document will work just as well?
>
> <meta http-equiv="refresh"
> content="3;URL=http://example.com/new-page.html"
> />
>
> Am I missing something?
>
> -Zak
Oh you're right I didn't read the original post. You can still use the OB
method and redirect to an HTML page containing the "sorry we're not here,
we're redirecting you to the right location" message and meta refresh
without goofing up the output in the original script. It's a straight
forward and clean transition.
- Kevin