php

PHP:Header

dafenqi
2023-08-28 / 0 评论 / 11 阅读 / 正在检测是否收录...

PHP:Header

RFC2616有相关的所有的状态信息的说明, 就状态码,大体总结如下:

  • 1xx: Informational - Request received, continuing process
  • 2xx: Success - The action was successfully received, understood,
  •   and accepted
  • 3xx: Redirection - Further action must be taken in order to
  •   complete the request
  • 4xx: Client Error - The request contains bad syntax or cannot be
  •   fulfilled
  • 5xx: Server Error - The server failed to fulfill an apparently
  •   valid request
状态码含义
100Continue 继续
101Switching Protocols 交换协议
200OK 好的
201Created 创建
202Accepted 接受
203Non-Authoritative Information 非授权信息
204No Content 没有内容
205Reset Content 重置内容
206Partial Content 部分内容
300Multiple Choices 多选
301Moved Permanently 永久移动
302Moved Temporarily 临时移动
303See Other 看到其他
304Not Modified 不修改
305Use Proxy 使用代理
400Bad Request 坏的请求
401Unauthorized 未经授权的
402Payment Required 付款要求
403Forbidden 被禁止的
404Not Found 没有找到
405Method Not Allowed 不允许
406Not Acceptable 不能接受的
407Proxy Authentication Required 需要代理认证
408Request Time-out 请求超时
409Conflict 冲突
410Gone 走了
411Length Required 长度要求
412Precondition Failed 失败的前提
413Request Entity Too Large 请求实体太大
414Request-URI Too Large 请求uri太大
415Unsupported Media Type 不支持的媒体类型
500Internal Server Error 服务器内部错误
501Not Implemented 没有实现
502Bad Gateway 坏的网关
503Service Unavailable 服务不可用
504Gateway Time-out 网关超时
505HTTP Version not supported 不支持HTTP版本

So, 举几个例子:

header("HTTP/1.1 404 Not Found", true, 404);
header("HTTP/1.0 401 Unauthorized");
header("Content-Type: text/html; charset=utf-8;");
header("Location:http://www.xxx.com");

RFC2616 http://www.faqs.org/rfcs/rfc2616

0

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /www/wwwroot/testblog.58heshihu.com/var/Widget/Archive.php on line 1032

评论 (0)

取消