is php header(location:link) equivalent to

Discussion in 'Website Development & Design' started by asad, Apr 1, 2012.

  1. asad

    asad
    uix_expand uix_collapse
    Member

    Joined:
    Jan 22, 2012
    Messages:
    199
    Likes Received:
    8
    <meta http-equiv="refresh" content="2;url=http://domain2.com/">

    is equivalent to
    <? php
    header("Location:".$link);
    exit;
    ?>

    or there is some difference between those. As both redirects the page to specified url
     
  2. johnnyS

    johnnyS
    uix_expand uix_collapse
    Member

    Joined:
    Jan 17, 2012
    Messages:
    59
    Likes Received:
    3
    HTML:
    <meta http-equiv="refresh" content="2;url=http://domain2.com/">
    will execute 2 seconds after the page loads..

    PHP:
    <? php
    header
    ("Location:".$link);
    exit;
    ?>
    will execute before anything is displayed on the website, if there is something displayed on the website and the header("Location:...") is executed it will return a warning and will not proceed with the redirect
     

Share This Page