PHP Common Headers Header Definition summary

Source: Internet
Author: User
Tags readfile

1<?PHP2 Header(' http/1.1-OK ');//OK normal Access3 Header(' http/1.1 404 Not Found ');//notifies the browser that the page does not exist4 Header(' http/1.1 301 Moved permanently ');//set the address to be permanently redirected 3015 Header(' location:http://www.ithhc.cn/');//jump to a new address6 Header(' refresh:10; url=http://www.ithhc.cn/');//delayed steering is a few seconds to jump7 Header(' x-powered-by:php/6.0.0 ');//Modify x-powered-by Information8 Header(' Content-language:en ');//Document Language9 Header(' content-length:1234 ');//Set Content LengthTen Header(' last-modified: '.gmdate(' d, D M Y h:i:s ',$time).‘ GMT ');//tell the browser when it was last modified One Header(' http/1.1 304 not Modified ');//Tell the browser that the contents of the document have not changed A    - ## #内容类型 # # # - Header(' content-type:text/html; Charset=utf-8 ');//page Encoding the Header(' Content-type:text/plain ');//Plain Text Format - Header(' Content-type:image/jpeg ');//JPG, JPEG - Header(' Content-type:application/zip ');//zip file - Header(' content-type:application/pdf ');//PDF File + Header(' Content-type:audio/mpeg ');//Audio Files - Header(' Content-type:text/css ');//css File + Header(' Content-type:text/javascript ');//js file A Header(' Content-type:application/json ');//JSON at Header(' content-type:application/pdf ');//PDF - Header(' Content-type:text/xml ');//XML - Header(' Content-type:application/x-shockw**e-flash ');//Flash Animation -    - ###### -    in ## #声明一个下载的文件 # # # - Header(' Content-type:application/octet-stream '); to Header(' Content-disposition:attachment; filename= "Itblog.zip"); + Header(' Content-transfer-encoding:binary '); - ReadFile(' Test.zip '); the ###### *    $ ## #对当前文档禁用缓存 # # #Panax Notoginseng Header(' Cache-control:no-cache, No-store, max-age=0, Must-revalidate '); - Header(' Expires:mon, Jul 1997 05:00:00 GMT '); the ###### +    A ## #显示一个需要验证的登陆对话框 # # # the Header(' http/1.1 401 Unauthorized ');  + Header(' Www-authenticate:basic realm= ' Top Secret ');  - ###### $    $    - ## #声明一个需要下载的xls文件 # # # - Header(' Content-disposition:attachment; Filename=ithhc.xlsx '); the Header(' Content-type:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet '); - Header(' Content-length: '.filesize('./test.xls ')); Wuyi Header(' Content-transfer-encoding:binary ');  the Header(' Cache-control:must-revalidate ');  - Header(' Pragma:public ');  Wu ReadFile('./test.xls ');  - ######


PHP Common Headers Header Definition summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.