what is difference between header and include, where which one should be used

前端 未结 8 1866
我在风中等你
我在风中等你 2021-02-07 18:58

I am confused with two terms

  1. header (\"Location:homepage_php\");

  2. include(\"homepage.php\");

I am g

8条回答
  •  伪装坚强ぢ
    2021-02-07 19:32

    the main difference in include and header is that the include does not change the url but header does. That means header sends you (redirects you) to that page but include fetch the page for you.

    see this example:
    this is from test.php which is including file from test2.php

    this is from test1.php using header so it redirects me to test2.php

提交回复
热议问题