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

php中的header用法

 header() is used to send raw HTTP headers. See the HTTP/1.1 specification for more information on HTTP headers.
使用范例
范例一:
 <?PHP
Header("Location: http://www.phpchina.com";);
exit;//在每个重定向之后都必须加上“exit",避免发生错误后,继续执行。
?>
<?php
header("refresh:2;url=http://www.baidu.com");
echo "正在加载,请稍等...<br>三秒后自动跳转至<a href="http://www.baidu.com" mce_href="http://www.baidu.com">百度</a>...";
?>
范例二:禁止页面在IE中缓存
使浏览者每次都能得到最新的资料,而不是 Proxy 或 cache 中的资料:
<?PHP
header( 'Expires: Fri, 4 Dec 2009 09:00:00 GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
header( 'Cache-Control: no-store, no-cache, must-revalidate' );
header( 'Cache-Control: post-check=0, pre-check=0', false );
header( 'Pragma: no-cache' ); //兼容http1.0和https
?>
CacheControl = no-cache  Pragma=no-cache  Expires = -1
如果服务器上的网页经常变化,就把Expires设置为-1,表示立即过期。如果一个网页每天凌晨1点更新,可以把Expires设置为第二天的凌晨1点。当HTTP1.1服务器指定CacheControl = no-cache时,浏览器就不会缓存该网页。
旧式 HTTP 1.0 服务器不能使用 Cache-Control 标题。所以为了向后兼容 HTTP 1.0 服务器,IE使用Pragma:no-cache 标题对 HTTP 提供特殊支持。如果客户端通过安全连接 (https://) 与服务器通讯,且服务器在响应中返回 Pragma:no-cache 标题,则 Internet Explorer 不会缓存此响应。
注意:Pragma:no-cache 仅当在安全连接中使用时才防止缓存,如果在非安全页中使用,处理方式与 Expires:-1 相同,该页将被缓存,但被标记为立即过期。
http-equiv meta标记:
在html页面中可以用http-equiv meta来标记指定的http消息头部。老版本的IE可能不支持html meta标记,所以最好使用http消息头部来禁用缓存。
范例三: 让使用者的浏览器出现找不到档案的信息。
网上很多资料这样写:php的函数header()可以向浏览器发送Status标头,
如 header(”Status: 404 Not Found”)。但实际上浏览器返回的响应却是:
HTTP/1.x 200 OK
Date: Thu, 03 Aug 2006 07:49:11 GMT
Server: Apache/2.0.55 (


相关文档:

Linux下C++实现PHP扩展中级应用(一)


此篇文章准备分2个部分来讲述:
    第一部分主要详细讲述一下怎么构建一个完成的C++应用扩展模块;
   
第二部分主要讲述在PHP及Zend框架下怎么使用Zend API和C++语言来实现自己所要的功能以及项目的开发;
    此篇文章所运用的环境在Linux
2.4.21-4.ELsmp(Red Ha ......

php ajax debug method make log in a text file

log into file
//
ob_start();
echo "<pre>";
print_r($data);
echo "</pre>";
$a=ob_get_contents();
//DAL::remove("insert into mytest(vvv) values('$a')");
$filename = "file.txt";
$file = fopen($filename, "w") ......

php无限分类的类

<?php
/**
 by lenush;
 */
class Tree
{
    var $data    = array();
    var $child    = array(-1=>array());
    var $layer    = array(-1=>-1);
    var $parent &nbs ......

php安装过程常见问题

php.ini 的搜索路径如下(按顺序):
    * SAPI 模块所指定的位置(Apache 2 中的 PHPIniDir 指令,CGI 和 CLI 中的 -c 命令行选项,NSAPI 中的 php_ini 参数,THTTPD 中的 PHP_INI_PATH 环境变量)
    *HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath(Windows 注册表位置)
  &nb ......

PHP创建excel文件简单的方法

<?php
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=php100.xls");

/* echo "A1\t B1\t C1\n";
echo "A1\t B1\t C1\n";
echo "A1\t B1\t C1\n";
*/
?>
<!--*********************************************报表***************************************** ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号