META or HEADER ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • StinkFinger

    META or HEADER ?

    All,
    Which is better and why ?

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


  • Oliver Grätz

    #2
    Re: META or HEADER ?

    StinkFinger schrieb:
    [color=blue]
    > All,
    > Which is better and why ?
    >
    > header("Locatio n: 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

    Comment

    • StinkFinger

      #3
      Re: META or HEADER ?

      Thank you.

      "Oliver Grätz" <oliver.graetz@ gmx.de> wrote in message
      news:408aeb08$0 $11408$9b4e6d93 @newsread2.arco r-online.net...[color=blue]
      > StinkFinger schrieb:
      >[color=green]
      >> All,
      >> Which is better and why ?
      >>
      >> header("Locatio n: 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]


      Comment

      • Adriaan

        #4
        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


        Comment

        Working...