1、php提供header()函数用来将html文档的表头以http协议发送至浏览器,高速浏览器如何处理这个页面:
header(string $str_header);
$str_header可以取很多值,用的最多的是以下三种:
Content-Type:xxxx/yyyyy
Location:xxxx:yyyy/zzzz
Status:nnn xxxxx
在调用header()之前不能有任何输出
例一:重定向
<?
header('location:http://www.cuit.edu.cn'); //重定向网站
die();
?>
例二:限制某网页不能被用户访问
<?
header("Status:404 Not Found");
?>