找回密码
 立即注册

QQ登录

只需一步,快速开始

教程经验总索引TVMW5/小日本5 索引【视频转换】小日本4/TE4XP 索引【视频转换】TAW4 / TDA3 索引【DVD打包软件】
Nero 索引DVD-Lab 索引【DVD打包软件】编解码器 索引 【必读】固顶帖011号
查看: 3300|回复: 0

[教程] PHP header函数

[复制链接]

9328

威望

242

金钱

1万

贡献

管理员

自由的灵魂

积分
99813
主题
5263
回帖
26212
注册时间
2003-4-10
最后登录
2024-3-28
发表于 2009-4-26 16:39:08 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
PHP header函数

<?PHP
/**
* HTTP Protocol defined status codes
* @param int $num
*/
function https($num) {
        $http = array (
                                100 => "HTTP/1.1 100 Continue",
                                101 => "HTTP/1.1 101 Switching Protocols",
                                200 => "HTTP/1.1 200 OK",
                                201 => "HTTP/1.1 201 Created",
                                202 => "HTTP/1.1 202 Accepted",
                                203 => "HTTP/1.1 203 Non-Authoritative Information",
                                204 => "HTTP/1.1 204 No Content",
                                205 => "HTTP/1.1 205 Reset Content",
                                206 => "HTTP/1.1 206 Partial Content",
                                300 => "HTTP/1.1 300 Multiple Choices",
                                301 => "HTTP/1.1 301 Moved Permanently",
                                302 => "HTTP/1.1 302 Found",
                                303 => "HTTP/1.1 303 See Other",
                                304 => "HTTP/1.1 304 Not Modified",
                                305 => "HTTP/1.1 305 Use Proxy",
                                307 => "HTTP/1.1 307 Temporary Redirect",
                                400 => "HTTP/1.1 400 Bad Request",
                                401 => "HTTP/1.1 401 Unauthorized",
                                402 => "HTTP/1.1 402 Payment Required",
                                403 => "HTTP/1.1 403 Forbidden",
                                404 => "HTTP/1.1 404 Not Found",
                                405 => "HTTP/1.1 405 Method Not Allowed",
                                406 => "HTTP/1.1 406 Not Acceptable",
                                407 => "HTTP/1.1 407 Proxy Authentication Required",
                                408 => "HTTP/1.1 408 Request Time-out",
                                409 => "HTTP/1.1 409 Conflict",
                                410 => "HTTP/1.1 410 Gone",
                                411 => "HTTP/1.1 411 Length Required",
                                412 => "HTTP/1.1 412 Precondition Failed",
                                413 => "HTTP/1.1 413 Request Entity Too Large",
                                414 => "HTTP/1.1 414 Request-URI Too Large",
                                415 => "HTTP/1.1 415 Unsupported Media Type",
                                416 => "HTTP/1.1 416 Requested range not satisfiable",
                                417 => "HTTP/1.1 417 Expectation Failed",
                                500 => "HTTP/1.1 500 Internal Server Error",
                                501 => "HTTP/1.1 501 Not Implemented",
                                502 => "HTTP/1.1 502 Bad Gateway",
                                503 => "HTTP/1.1 503 Service Unavailable",
                                504 => "HTTP/1.1 504 Gateway Time-out"
                        );
        header($http[$num]);
}
?>
IsaacZ的发言中如果提到任何字母缩写或专有名词,在本论坛中一般都能搜索到。点此立即搜索点拨论坛。如有搜索不到的,请尝试搜索百度百科,或者跟帖提问。
发帖前请注意看置顶帖。如果你发现自己的问题没有得到回答,说明你的问题提错了地方或者提问前未先阅读本版规则固顶帖011号
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|点拨论坛

GMT+8, 2024-3-29 01:54 , Processed in 0.291211 second(s), 3 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表