Connecting Tech Pros Worldwide Help | Site Map

META or HEADER ?

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 04:58 AM
StinkFinger
Guest
 
Posts: n/a
Default META or HEADER ?

All,
Which is better and why ?

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



  #2  
Old July 17th, 2005, 04:58 AM
Oliver Grätz
Guest
 
Posts: n/a
Default 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

  #3  
Old July 17th, 2005, 04:58 AM
StinkFinger
Guest
 
Posts: n/a
Default 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]


  #4  
Old July 17th, 2005, 04:58 AM
Adriaan
Guest
 
Posts: n/a
Default 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


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.