php常见的header操作

  1. 404:
    header ("HTTP/1.1 404 Not Found");
  2. 301:
    header ("HTTP/1.1 301 Moved Permanently"); 
    header ("Location:http://www.baidu.com");
  3. 下载文件:
    header ('Content-type: application/file');
    header ("Content-Disposition: attachment; filename='test.file'");
    readfile ("test.file");
  4. 允许跨域:
    header('Access-Control-Allow-Origin:*');
  5. 设置自定义header头:
    header('Access-Control-Allow-Headers:WWW-Authenticate,Authorization,Set-Cookie,X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version,name');

分享标题:php常见的header操作
链接URL:http://bzwzjz.com/article/gogcjs.html

其他资讯

Copyright © 2007-2020 广东宝晨空调科技有限公司 All Rights Reserved 粤ICP备2022107769号
友情链接: 成都网站设计 定制网站建设多少钱 网站建设 成都网站建设 成都网站设计 成都营销网站建设 成都网站设计 成都网站建设公司 app网站建设 高端定制网站设计 成都营销网站制作 网站制作公司 成都网站制作 成都定制网站建设 网站建设开发 成都定制网站建设 营销型网站建设 梓潼网站设计 成都网站建设推广 成都网站设计 成都网站设计制作公司 达州网站设计