Connecting Tech Pros Worldwide Forums | Help | Site Map

META or HEADER ?

StinkFinger
Guest
 
Posts: n/a
#1: Jul 17 '05
All,
Which is better and why ?

header("Location: http://www.example.com/");
or
echo "<META HTTP-EQUIV=\"refresh\" content=\"0; url=/index.php\">";



Oliver Grätz
Guest
 
Posts: n/a
#2: Jul 17 '05

re: META or HEADER ?


StinkFinger schrieb:
[color=blue]
> All,
> Which is better and why ?
>
> header("Location: http://www.example.com/");
> or
> echo "<META HTTP-EQUIV=\"refresh\" content=\"0; url=/index.php\">";[/color]

Header!
The Location-Header can be handled on the HTTP-level, whereas for
the META-Tag the browser has to load and parse the HTML-part.
It's slower and not that error-resistent.

AllOlli

StinkFinger
Guest
 
Posts: n/a
#3: Jul 17 '05

re: META or HEADER ?


Thank you.

"Oliver Grätz" <oliver.graetz@gmx.de> wrote in message
news:408aeb08$0$11408$9b4e6d93@newsread2.arcor-online.net...[color=blue]
> StinkFinger schrieb:
>[color=green]
>> All,
>> Which is better and why ?
>>
>> header("Location: http://www.example.com/");
>> or
>> echo "<META HTTP-EQUIV=\"refresh\" content=\"0; url=/index.php\">";[/color]
>
> Header!
> The Location-Header can be handled on the HTTP-level, whereas for
> the META-Tag the browser has to load and parse the HTML-part.
> It's slower and not that error-resistent.
>
> AllOlli
>[/color]


Adriaan
Guest
 
Posts: n/a
#4: Jul 17 '05

re: META or HEADER ?


"Oliver Grätz" wrote[color=blue]
> The Location-Header can be handled on the HTTP-level, whereas for
> the META-Tag the browser has to load and parse the HTML-part.
> It's slower and not that error-resistent.[/color]

And has a different (for most needs: better) behavior for the browser's Back
button: the old (requested) location is not stored in the history.

Adriaan


Closed Thread