Common HTTP header settings for PHP header functions, Phpheader functions
Okheader (' http/1.1 OK ');//Set a 404 Header: Header (' http/1.1 404 Not Found ');//Set address is permanently redirected header (' http/1.1 301 Moved Permanently ');//Go to a new address header (' location:http://www.example.org/');//File Delay Turn: header (' Refresh:10; url=http:// www.example.org/');p rint ' You'll be being redirected in seconds ';//Of course, you can also use HTML syntax to implement//
Override X-powered-by:php:header (' x-powered-by:php/4.4.0′); header (' x-powered-by:brain/0.6b ');//Document Language header (' Content-language:en ');//Tell the browser last modified time: +/-() –60; or Filemtime ($FN), Etcheader (' last-modified: '. Gmdate (' d, D M Y h:i:s ', $time). ' GMT ');//Tell the browser that the document content has not changed header (' http/1.1 304 not Modified ');//Set Content Length header (' content-length:1234′);// Set to a download type header (' Content-type:application/octet-stream '); header (' content-disposition:attachment; Filename= ') Example.zip "'); header (' content-transfer-encoding:binary ');//load the file to Send:readfile (' example.zip ');// Disables the cache header for the current document (' Cache-control:no-cache, No-store, max-age=0, Must-revalidate '); header (' Expires:mon, 1997 Jul 05:00:00 GMT '); Date in the Pastheader (' Pragma:no-cache ');//Set Content Type: Header (' content-type:text/html; charset=iso-8859-1′); Header (' content-type:text/html; charset=utf-8′); header (' Content-type:text/plain '); Plain Text Format header (' Content-type:image/jpeg '); Jpg***header (' Content-type:application/zip '); Zip textHeader (' content-type:application/pdf '); PDF file Header (' Content-type:audio/mpeg '); Audio file header (' Content-type:application/x-shockw**e-flash '); Flash animation//Display Login Dialog header (' http/1.1 401 Unauthorized '); header (' Www-authenticate:basic realm= ' Top Secret "');p rint ' Text that would be displayed if the user hits cancel or ';p rint ' enters wrong login data ';
http://www.bkjia.com/PHPjc/1022310.html www.bkjia.com true http://www.bkjia.com/PHPjc/1022310.html techarticle PHP Header function Common HTTP header settings, Phpheader function//okheader (' http/1.1 OK ');//Set a 404 Header: Header (' http/1.1 404 Not Found ');// Set address to be permanently redirected ...