General summary of common usage of PHP headers (favorites)

Source: Internet
Author: User
Tags 503 service temporarily unavailable
This article for you to share the common header information about PHP usage Summary, the need for friends can look at the summary of the PHP header common usage is very detailed.

Some common headers header information header (' http/1.1 OK '); OK normal access header (' http/1.1 404 Not Found '); Notification Browser page does not exist header (' http/1.1 301 Moved permanently '); Set the address to be permanently redirected 301header (' http/1.1 503 Service temporarily unavailable ');//Service Unavailable header (' location:https:// zhangzifan.com/'); Jump to a new address header (' refresh:10; url=https://zhangzifan.com/'); The delayed turn is the jump header (' x-powered-by:php/6.0.0 ') every few seconds; Modify the X-powered-by Information header (' Content-language:en '); Document Language header (' content-length:1234 '); Set the content Length header (' last-modified: '. Gmdate (' d, D M Y h:i:s ', $time). ' GMT '); Tells the browser the last time the header was modified (' http/1.1 304 not Modified '); Tells the browser that the document content has not changed/** content type **/header (' content-type:text/html; Charset=utf-8 '); Page encoding 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 file header (' Content-type:text/css '); CSS file header (' Content-type:text/javascript '); //js file header (' Content-type:application/json '); Jsonheader (' content-type:application/pdf ');  PDF header (' Content-type:text/xml '); Xmlheader (' Content-type:application/x-shockw**e-flash '); Flash animation/** Declaration of a downloaded file **/header (' Content-type:application/octet-stream '); Header (' content-disposition:attachment; filename= ' Itblog.zip '); Header (' content-transfer-encoding:binary '); ReadFile (' Test.zip '); /** disable caching for the current document **/header (' Cache-control:no-cache, No-store, max-age=0, Must-revalidate ');  Header (' Expires:mon, Jul 1997 05:00:00 GMT ');  /** Displays a login dialog box **/header (' http/1.1 401 Unauthorized ') that needs to be verified;   Header (' Www-authenticate:basic realm= ' Top Secret '); /** declares an XLS file that needs to be downloaded **/header (' content-disposition:attachment; filename=ithhc.xlsx '); header (' Content-type: Application/vnd.openxmlformats-officedocument.spreadsheetml.sheet '); header (' Content-length: '. FileSize ('./  Test.xls '));  Header (' content-transfer-encoding:binary ');  Header (' cache-control:must-revalidate ');  Header (' Pragma:public '); REadfile ('./test.xls '); 

The above is the collection of some common PHP header information, some of which are not used, by the way are put out, in fact, there are many, here do not do too much finishing, know some common good.

Related Article

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.