PHP中使用HTTP协议的状态码
<?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]);
}
?>
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/cho__cho/archive/2008/08/07/2782951.aspx
相关文档:
实例一:无参的存储过程
$conn = mysql_connect('localhost','root','root') or die ("数据连接错误!!!");
mysql_select_db('test',$conn);
$sql = "
create procedure myproce()
begin
INSERT INTO user (id, username, sex) VALUES (NULL, 's', '0');
end;
";
mysql_query($sql);//创建一个myproce的存储过程
......
操作系统: windows xp
php版本:5.2.5 http://www.php.net/downloads.php
Apache http server 版本:2.2.6http://httpd.apache.org/download.cgi
Mysql版本: 6.0.3http://dev.mysql.com/get/Downloads/MySQL-6.0
1.apache的安装:
1)双击apache_2.2.6-win32-x86-no_ssl.msi图标,启动apache安装程序;
2)安装以一个欢迎 ......
转:http://blog.iyi.cn/start/
问题:
有没有办法在php中实现多线程呢?
假设你正在写一个基于多台服务器的php应用,理想的情况时同时向多台服务器发送请求,而不是一台接一台。
可以实现吗?
回答:
当有人想要实现并发功能时,他们通常会想到用fork或者spawn threads,但是当他们发现php不支持多线程的时候,大 ......
对 CodeIgniter 的介绍
大多数PHPer都想写出运行状态良好的应用程序,而且希望尽可能做得简单且不费事。这篇文章是有关 CodeIgniter的(以后简称CI),CI是一个达成上面目的的所谓框架。
如果你只是要达成一个最终的结果,而把中间所有的编码细节和复杂统统丢给一个框架,CI是你最好的朋友。
CI有很多优点:免费, 轻量级, ......
二分钟: 建立一个 CodeIgniter 网站
用CI建一个网站很容易。 这一章很短,解释了用CI制作网站时发生了些什么,哪些文件被创建,让我们来瞧一瞧:
. 创建网站需要什么软件?
. 安装 CI 文件: 一个简单的下载和解压缩操作
. CI 的基本设置: 有哪些文件夹及它们是如何组织的
. CI 安装时默认的控制器和视图
. 一些简单的 ......