php如何设置header-PHP问题

资源魔 29 0

php设置header的办法:

起首新建一个php文件,而后正在该文件的头部退出函数”header“

//ok
header(‘HTTP/1.1 200 OK');
//设置一个404头:
header(‘HTTP/1.1 404 Not Found');
//设置地点被永世的重定向
header(‘HTTP/1.1 301 Moved Permanently');
//转到一个新地点
header(‘Location: http://www.example.org/‘);
//文件提早转向:
header(‘Refresh: 10; url=http://www.example.org/‘);

最初将该文件正在效劳器环境下运转便可

相干参考:资源魔

以上就是php若何设置header的具体内容,更多请存眷资源魔其它相干文章!

标签: php php教程 php故障解决 php使用问题

抱歉,评论功能暂时关闭!