<p><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); "><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(247, 252, 255); "><1> 重定向功能,这种最常见</span><br /></span></p><p><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); "><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(247, 252, 255); "><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); "><?php </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">Header("Location: http://www.php.net"); </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">?> </span><br /></span></span></p><p><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); "><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(247, 252, 255); "><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); "><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(247, 252, 255); ">2> 强制用户每次访问这个页面时获取最新资料,而不是使用存在客户端的缓存。</span><br /></span></span></span></p><p><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); "><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(247, 252, 255); "><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); "><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(247, 252, 255); "><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); "><?php </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">//告诉浏览器此页面的过期时间(用格林威治时间表示),只要是已经过去的日期即可。 </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">header("Expires: Mon, 26 Jul 1970 05:00:00 GMT"); </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">//告诉浏览器此页面的最后更新日期(用格林威治时间表示)也就是当天,目的就是强迫浏览器获取最新资料 </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">//告诉客户端浏览器不使用缓存 </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">header("Cache-Control: no-cache, must-revalidate"); </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">//参数(与以前的服务器兼容),即兼容HTTP1.0协议 </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">header("Pragma: no-cache"); </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">//输出MIME类型 </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">header("Content-type: application/file"); </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">//文件长度 </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">header("Content-Length: 227685"); </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">//接受的范围单位 </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">header("Accept-Ranges: bytes"); </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">//缺省时文件保存对话框中的文件名称 </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">header("Content-Disposition: attachment; filename=$filename"); </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">?></span><br /></span></span></span></span></p><p><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); "><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(247, 252, 255); "><3> 输出状态值到浏览器,主要用于访问权限控制 </span><br /></span></p><p><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); "><?php </span></p><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">header('HTTP/1.1 401 Unauthorized'); </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">header('status: 401 Unauthorized'); </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><p><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">?></span></p><p><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); "><br /></span></p><p><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); "><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); "><?php </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">header('HTTP/1.1 404 Not Found'); </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">header("status: 404 Not Found"); </span><br style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; " /><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); ">?> </span><br /></span></p><p><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); "><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); "><br /></span></span></p><p><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); "><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); "><span class="default" style="color: rgb(0, 0, 187); background-color: rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14px; text-align: left; ">$_SERVER</span><span class="keyword" style="color: rgb(0, 119, 0); background-color: rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14px; text-align: left; ">[</span><span class="string" style="color: rgb(221, 0, 0); background-color: rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14px; text-align: left; ">'HTTPS'</span><span class="keyword" style="color: rgb(0, 119, 0); background-color: rgb(240, 240, 240); font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 14px; text-align: left; ">]</span><br /></span></span></p><p><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); "><span style="color: rgb(51, 51, 51); font-family: Arial, Tahoma, Verdana, sans-serif; font-size: 14px; line-height: 25px; text-align: left; background-color: rgb(221, 237, 251); "><br /></span></span></p>