<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[BIWEB开源PHP WMS系统创始人ArthurXF肖飞的blog]]></title> 
<link>http://www.bizeway.net/index.php</link> 
<description><![CDATA[网务通 - 网务公司发展之路]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[BIWEB开源PHP WMS系统创始人ArthurXF肖飞的blog]]></copyright>
<item>
<link>http://www.bizeway.net/read.php?</link>
<title><![CDATA[PHP 常见header 状态 ]]></title> 
<author>ArthurXF &lt;arthurxf@gmail.com&gt;</author>
<category><![CDATA[PHP]]></category>
<pubDate>Wed, 19 Dec 2012 10:09:22 +0000</pubDate> 
<guid>http://www.bizeway.net/read.php?</guid> 
<description>
<![CDATA[ 
	01.&lt;?php &nbsp;<br />02.//200 正常状态 &nbsp;<br />03.header('HTTP/1.1 200 OK'); &nbsp;<br />04. &nbsp;<br />05.// 301 永久重定向，记得在后面要加重定向地址 Location:$url &nbsp;<br />06.header('HTTP/1.1 301 Moved Permanently'); &nbsp;<br />07. &nbsp;<br />08.// 重定向，其实就是302 暂时重定向 &nbsp;<br />09.header('Location: <a href="http://www.tj-px.com/" target="_blank">http://www.tj-px.com/</a>'); &nbsp;<br />10. &nbsp;<br />11.// 设置页面304 没有修改 &nbsp;<br />12.header('HTTP/1.1 304 Not Modified'); &nbsp;<br />13. &nbsp;<br />14.// 显示登录框， &nbsp;<br />15.header('HTTP/1.1 401 Unauthorized'); &nbsp;<br />16.header('WWW-Authenticate: Basic realm=&quot;登录信息&quot;'); &nbsp;<br />17.echo '显示的信息！'; &nbsp;<br />18. &nbsp;<br />19.// 403 禁止访问 &nbsp;<br />20.header('HTTP/1.1 403 Forbidden'); &nbsp;<br />21. &nbsp; <br />22.// 404 错误 &nbsp;<br />23.header('HTTP/1.1 404 Not Found'); &nbsp;<br />24. &nbsp;<br />25.// 500 服务器错误 &nbsp;<br />26.header('HTTP/1.1 500 Internal Server Error'); &nbsp;<br />27. &nbsp; <br />28.// 3秒后重定向指定地址(也就是刷新到新页面与 &lt;meta http-equiv=&quot;refresh&quot; content=&quot;10;http://www.tj-px.com/ /&gt; 相同) &nbsp;<br />29.header('Refresh: 3; url=http://www.tj-px.com/'); &nbsp;<br />30.echo '10后跳转到http://www.tj-px.com'; &nbsp;<br />31. &nbsp; <br />32.// 重写 X-Powered-By 值 &nbsp;<br />33.header('X-Powered-By: PHP/5.3.0'); &nbsp;<br />34.header('X-Powered-By: Brain/0.6b'); &nbsp;<br />35. &nbsp; <br />36.//设置上下文语言 &nbsp;<br />37.header('Content-language: en'); &nbsp;<br />38. &nbsp; <br />39.// 设置页面最后修改时间（多用于防缓存） &nbsp;<br />40.$time = time() - 60; //建议使用filetime函数来设置页面缓存时间 &nbsp;<br />41.header('Last-Modified: '.gmdate('D, d M Y H:i:s', $time).' GMT'); &nbsp;<br />42. &nbsp;<br />43.// 设置内容长度 &nbsp;<br />44.header('Content-Length: 39344'); &nbsp;<br />45. &nbsp; <br />46.// 设置头文件类型，可以用于流文件或者文件下载 &nbsp;<br />47.header('Content-Type: application/octet-stream'); &nbsp;<br />48.header('Content-Disposition: attachment; filename=&quot;example.zip&quot;'); &nbsp; <br />49.header('Content-Transfer-Encoding: binary'); &nbsp;<br />50.readfile('example.zip');//读取文件到客户端 &nbsp;<br />51. &nbsp; <br />52.//禁用页面缓存 &nbsp;<br />53.header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate'); &nbsp;<br />54.header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); &nbsp; <br />55.header('Pragma: no-cache'); &nbsp;<br />56. &nbsp; <br />57.//设置页面头信息 &nbsp;<br />58.header('Content-Type: text/html; charset=iso-8859-1'); &nbsp;<br />59.header('Content-Type: text/html; charset=utf-8'); &nbsp;<br />60.header('Content-Type: text/plain'); &nbsp; <br />61.header('Content-Type: image/jpeg'); &nbsp; <br />62.header('Content-Type: application/zip'); &nbsp; <br />63.header('Content-Type: application/pdf'); &nbsp; <br />64.header('Content-Type: audio/mpeg'); &nbsp;<br />65.header('Content-Type: application/x-shockwave-flash'); &nbsp; <br />66.//.... 至于Content-Type 的值 可以去查查 w3c 的文档库，那里很丰富 &nbsp;<br />67.?&gt; &nbsp;<br /> &nbsp;<br/>Tags - <a href="tag.php?tag=php" rel="tag">php</a> , <a href="tag.php?tag=header" rel="tag">header</a>
]]>
</description>
</item><item>
<link>http://www.bizeway.net/read.php?&amp;guid=0#topreply</link>
<title><![CDATA[[评论] PHP 常见header 状态 ]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.bizeway.net/read.php?&amp;guid=0#topreply</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>