xuesn 发表于 2018-12-22 14:12:23

php header

  PHPheader()函数用法
  
  /***Function:PHPheader()examples(PHP)
  **Desc:Someexamplesonhowtousetheheader()functionofPHPYoufindadetailedtutorialatexpertsrt.com(English)oratffm.junetz.de(German).Theseisalsoagoodhelpaboutcachingatweb-caching.com.
  **Example:seebelow.Tip:Youcanusethesesitestocheckyourheaders:web-sniffer.net,delorie.comorwww.forret.com.
  **Author:JonasJohn
  */
  //fix404pages:
  header('HTTP/1.1200OK');
  //set404header:
  header('HTTP/1.1404NotFound');
  //setMovedPermanentlyheader(goodforredrictions)
  //usewithlocationheader
  header('HTTP/1.1301MovedPermanently');
  //redirecttoanewlocation:
  header('Location:http://www.example.org/');
  //redrictwithdelay:
  header('Refresh:10;url=http://www.example.org/');
  print'Youwillberedirectedin10seconds';
  //youcouldalsousetheHTMLsyntax://
页: [1]
查看完整版本: php header