PHP Common Header Status

Source: Internet
Author: User

Reprint: http://blog.csdn.net/mothz/article/details/6029810

<?PHP//200 normal StateHeader(' http/1.1 OK ');//301 Permanent Redirect, remember to add a redirect address at the back location: $urlHeader(' http/1.1 301 Moved permanently ');//redirect , in fact, is 302 temporary redirectHeader(' location:http://www.maiyoule.com/');//Settings page 304 Not modifiedHeader(' http/1.1 304 not Modified ');//Display the login box,Header(' http/1.1 401 Unauthorized ');Header(' Www-authenticate:basic realm= ' login information ');Echo' Show the information! ‘;//403 No AccessHeader(' http/1.1 403 Forbidden '); //404 ErrorHeader(' http/1.1 404 Not Found ');//500 Server ErrorHeader(' http/1.1 Internal Server Error '); //REDIRECT specified address after 3 seconds (i.e. refresh to new page same as <meta http-equiv= "Refresh" content= "10;http://www.maiyoule.com//>")Header(' Refresh:3; url=http://www.maiyoule.com/');Echo' Jump to http://www.maiyoule.com ' after 10 '; //overriding the x-powered-by valueHeader(' x-powered-by:php/5.3.0 ');Header(' x-powered-by:brain/0.6b '); //Setting the context languageHeader(' Content-language:en '); //set the last modified time of the page (more for anti-cache)$time= Time()-60;//we recommend using the FILETIME function to set the page cache timeHeader(' last-modified: '.gmdate(' d, D M Y h:i:s ',$time).‘ GMT ');//Set Content LengthHeader(' content-length:39344 '); //sets the header file type, which can be used for streaming files or file downloadsHeader(' Content-type:application/octet-stream ');Header(' Content-disposition:attachment; filename= "Example.zip"); Header(' Content-transfer-encoding:binary ');ReadFile(' Example.zip ');//read file to client//disable page CachingHeader(' Cache-control:no-cache, No-store, max-age=0, Must-revalidate ');Header(' Expires:mon, Jul 1997 05:00:00 GMT '); Header(' Pragma:no-cache '); //Set Page header informationHeader(' content-type:text/html; Charset=iso-8859-1 ');Header(' content-type:text/html; Charset=utf-8 ');Header(' Content-type:text/plain '); Header(' Content-type:image/jpeg '); Header(' Content-type:application/zip '); Header(' Content-type:application/pdf '); Header(' Content-type:audio/mpeg ');Header(' Content-type:application/x-shockwave-flash '); //.... As for the value of Content-type, you can check the document library, which is very rich?>

PHP Common Header Status

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.