Re: header() refresh vs location
| From: | Kevin Stone | Date: | Tue, 14 Oct 2003 18:36:34 +0000 |
| Subject: | Re: header() refresh vs location | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-166100@lists.php.net to get a copy of this message | ||
The Refresh directive is a valid header. I've used it for many years and it seems to be
supported by the majority of browsers. However I've never read anything that would indicate
that Refresh works any differently than Location. The only difference is that Refresh allows you to
set a number of seconds before redirecting to the given URL. As to whether or not it will solve
your problem is something only you can answer.
- Kevin
"Chris Hubbard" <chris@wildcharacters.com> wrote in message news:AMEHIMKKMFIMCOJPPEEEMEJLCIAA.chris@wildcharacters.com...
> All,
> I have done a number of searches.
> I have read the online documentation and user supplied comments.
>
> I recently ran into problem using:
>
> -some code here to create session and set variables-
> header('Location: index.php');
>
> where the sessions would sometimes get "lost", they wouldn't make it to the
> index.php page. A print_r on $_SESSION would display an empty array. And
> yes the sessions are getting set properly. The same code works on three
> different servers, with no modifications.
>
> So a friend recommended using:
> header ("Refresh: 0; url=index.php");
>
> I haven't seen documentation for "refresh" in the header function. Is there
> any reason to use one in lieu of the other? Any comments on 'refresh'?
>
> As I said, I've looked at the online documentation:
> this page: http://us4.php.net/manual/en/function.header.php
> doesn't have the
> word "refresh" on it.
> this page: http://www.w3.org/Protocols/rfc2616/rfc2616
> doesn't have the word
> "refresh" on it.
> this page:
> http://us4.php.net/manual/en/function.headers-sent.php does have
> the word "refresh" but it's not relevant.
>
> Thanks in advance.
>
> Chris Hubbard
> chris@wildcharacters.com
> www.wildcharacters.com
> 425 481 2020
>
> php based web application development
>
> Y! hoponpopontoponmoponcop@yahoo.com
> MSN another_ganesha@hotmail.com
> AIM ganeshacph