成都创新互联网站制作重庆分公司

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操作
当前地址:http://cxhlcq.com/article/gogcjs.html

其他资讯

在线咨询

微信咨询

电话咨询

028-86922220(工作日)

18980820575(7×24)

提交需求

返回顶部