Re: redirect using php
| From: | Mark Kelly | Date: | Wed, 05 Apr 2006 13:57:23 +0000 |
| Subject: | Re: redirect using php | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-233260@lists.php.net to get a copy of this message | ||
On Wednesday 05 April 2006 14:33, Chris Shiflett wrote:
> Mark Kelly wrote:
> > > > You can also use something like:
> > > >
> > > > echo "<meta http-equiv=\"Refresh\"
> > > > content=\"0;url=$from_page\">";
> > >
> > > There's no need to use a meta tag to mimic HTTP headers. PHP
> > > provides the header() function.
> >
> > I have been using that method when I got part-way through some
> > processing that produces output, and hit something that requires a
> > redirect. As I understand it headers are no use to me here.
>
> You're still using a Refresh header. The difference is that you're using
> a meta tag to mimic the header (e.g., http-equiv).
I understand that. I'm sorry, I am obviously not making myself clear...
The php manual page tells me that I can't use header() after any output has
been sent, thus making it useless in my (obviously badly explained) case
above.
What happens in my app is: the data processing is in several discrete
sequential stages, each one echoing status to the user. When it hits
something that requires additional pre-processing by a different page, I
use the http-equiv redirect with a 3 second delay so the user can read the
message telling them what is going on.
Am I correct that header() is no use for this, and is there a "correct" way
to achieve what I describe? I'm a bit concerned that my ignorance may have
led me to do this wrong - this is my first php app.
Also, thanks to all the folk suggesting javascript, but this is an internal
app, and policy has javascript turned off on all browsers.
Thanks again,
Mark