现在的位置: 首页 > 综合 > 正文

PHP(http协议)相关应用知识

2012年03月16日 ⁄ 综合 ⁄ 共 313字 ⁄ 字号 评论关闭

1、通过http响应,控制浏览器在一定时间跳转

<?php

        //通过http响应,控制浏览器在一定时间跳转
     //3秒 浏览器跳转到指定url
        //header("Refresh: 3; url=http://www.baidu.com");
        header("Refresh: 3; url=http://localhost/http/Myimport.php");

?>

2、设置禁用缓存,通过httpwatch抓包工具可以查看

<?php

    //禁用缓存
    header("Expires: -1");
    header("Cache-Control: no-cache");
    header("pragam: no-cache");
    
    echo "禁用缓存";
?>

 

 

抱歉!评论已关闭.