php常见的header操作
header ("HTTP/1.1 404 Not Found");
301:
header ("HTTP/1.1 301 Moved Permanently"); header ("Location:http://www.baidu.com");
下载文件:
header ('Content-type: application/file');header ("Content-Disposition: attachment; filename='test.file'");readfile ("test.file");
允许跨域:
header('Access-Control-Allow-Origin:*');
设置自定义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');
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。