时间:2021-07-01 10:21:17 帮助过:17人阅读
- <br><!--?php <BR-->// fix 404 pages: <br>header('HTTP/1.1 200 OK'); <br>// set 404 header: <br>header('HTTP/1.1 404 Not Found'); <br>// set Moved Permanently header (good for redrictions) <br>// use with location header <br>header('HTTP/1.1 301 Moved Permanently'); <br>// redirect to a new location: <br>header('Location: http://www.example.org/'); <br>// redrict with delay: <br>header('Refresh: 10; url=http://www.example.org/'); <br>print 'You will be redirected in 10 seconds'; <br>// you could also use the HTML syntax:// <meta http-equiv="refresh" content="10;http://www.example.org/ /> <BR>// override X-Powered-By: PHP: <BR>header('X-Powered-By: PHP/4.4.0'); <BR>header('X-Powered-By: Brain/0.6b'); <BR>// content language (en = English) <BR>header('Content-language: en'); <BR>// last modified (good for caching) <BR>$time = time() – 60; // or filemtime($fn), etc <BR>header('Last-Modified: '.gmdate('D, d M Y H:i:s', $time).' GMT'); <BR>// header for telling the browser that the content <BR>// did not get changed <BR>header('HTTP/1.1 304 Not Modified'); <BR>// set content length (good for caching): <BR>header('Content-Length: 1234'); <BR>// Headers for an download: <BR>header('Content-Type: application/octet-stream'); <BR>header('Content-Disposition: attachment; filename=" example.zip"');="" <br="">header('Content-Transfer-Encoding: binary'); <br>// load the file to send:readfile('example.zip'); <br>// Disable caching of the current document: <br>header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate'); <br>header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); <br>// Date in the pastheader('Pragma: no-cache'); <br>// set content type: <br>header('Content-Type: text/html; charset=iso-8859-1'); <br>header('Content-Type: text/html; charset=utf-8'); <br>header('Content-Type: text/plain'); <br>// plain text file <br>header('Content-Type: image/jpeg'); <br>// JPG picture <br>header('Content-Type: application/zip'); <br>// ZIP file <br>header('Content-Type: application/pdf'); <br>// PDF file <br>header('Content-Type: audio/mpeg'); <br>// Audio MPEG (MP3,…) file <br>header('Content-Type: application/x-shockwave-flash'); <br>// Flash animation// show sign in box <br>header('HTTP/1.1 401 Unauthorized'); <br>header('WWW-Authenticate: Basic realm="Top Secret"'); <br>print 'Text that will be displayed if the user hits cancel or '; <br>print 'enters wrong login data'; <br>?> <br><br>
- <p></p>
- <p align="left"><span id="url" itemprop="url">http://www.bkjia.com/PHPjc/324044.html</span><span id="indexUrl" itemprop="indexUrl">www.bkjia.com</span><span id="isOriginal" itemprop="isOriginal">true</span><span id="isBasedOnUrl" itemprop="isBasedOnUrl">http://www.bkjia.com/PHPjc/324044.html</span><span id="genre" itemprop="genre">TechArticle</span><span id="description" itemprop="description">在php语言中,header()这个函数很有用的,尤其在用到ajax时候,他会帮你解决一些意想不到的问题。下面是header的一些详细讲解。希望对phpe...</span></p>