易截截图软件、单文件、免安装、纯绿色、仅160KB

php中使用header函数的http头设置

/ 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/');
print 'You will be redirected in 10 seconds';
//当然,也可以使用html语法实现
// <meta http-equiv="refresh" content="10;http://www.example.org/ />
// override X-Powered-By: PHP:
header('X-Powered-By: PHP/4.4.0');
header('X-Powered-By: Brain/0.6b');
//文档语言
header('Content-language: en');
//告诉浏览器最后一次修改时间
$time = time() - 60; // or filemtime($fn), etc
header('Last-Modified: '.gmdate('D, d M Y H:i:s', $time).' GMT');
//告诉浏览器文档内容没有发生改变
header('HTTP/1.1 304 Not Modified');
//设置内容长度
header('Content-Length: 1234');
//设置为一个下载类型
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="example.zip"');
header('Content-Transfer-Encoding: binary');
// load the file to send:
readfile('example.zip');
// 对当前文档禁用缓存
header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header('Pragma: no-cache');
//设置内容类型:
header('Content-Type: text/html; charset=iso-8859-1');
header('Content-Type: text/html; charset=utf-8');
header('Content-Type: text/plain'); //纯文本格式
header('Content-Type: image/jpeg'); //JPG***
header('Content-Type: application/zip'); // ZIP文件
header('Content-Type: application/pdf'); // PDF文件
header('Content-Type: audio/mpeg'); // 音频文件
header('Content-Type: application/x-shockw**e-flash'); //Flash动画
//显示登陆对话框
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: Basic realm="Top Secret"');
print 'Text that will be displayed if the user hits cancel or ';
print 'enters wrong login data';


相关文档:

YAHOO PHP面试题

知道差距了,努力吧!
1. Which of the following will not add john to the users array?
1. $users[] = 'john';
2. array_add($users,'john');
3. array_push($users,'john');
4. $users ||= 'john';
2. What's the difference between sort(), asort() and ksort? Under what circumstances would you use each o ......

web server使用php生成web页面的三种方式

查找mysql_pconnect时在mysql帮助文档上发现的,记在这里。
web server使用php生成一个web页面的三式有以下三种:
一:把PHP作为CGI Wrapper。这种方式下,每个到达web server的请求都会导致一个php解析器进程被创建,当这个php页面执行结束时,这个php解析器进程终止。
二:
在多进程的web server中,把php作为web
se ......

lighttpd + mysql + php(fast cgi)安装与配置

准备:
lighttpd-1.4.15.tar.gz
php-4.4.2.tar.gz
mysql-5.0.20a.tar.gz
开始:
1 编译安装lighttpd
 # tar zxvf lighttpd-1.4.15.tar.gz
 # cd lighttpd-1.4.15
 #  ls
 # ./configure --prefix=/usr/local/lighttpd    //此部无法编译时提示安装prce-devel
 #&nbs ......

PHP正则表达式函数

正则表达式自己一直不熟悉,这2天在网上一直看关于它的文章,自己总结了几个函数。
1.preg_match()
函数原型:int preg_match (string $pattern, string $content [, array
$matches])
preg_match
()函数在$content字符串中搜索与$pattern给出的正则表达式相匹配的内容。如果提供了$matches,则将匹配结果放入其中� ......

PHP函数ereg与preg的区别

      1、ereg里面是不需要也不能使用分隔符和修饰符的,所以ereg的功能比preg要弱上不少。
  2、关于".":点在正则里面一般是除了换行符以外的全部字符,但是在ereg里面的"."是任意字符,即包括换行符!如果在preg里面希望"."
能够包括换行符,可以在修饰符中 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号