Posts Tagged ‘刷新’
Aug
03

 

<?php
$time=time();
setcookie("url", $time, $time+3600);

echo $time.'<br>';
?>

<a href="?<?php echo $time;?>">next</a>

<script>
if(getCookie('url')!='<?php echo $time;?>')location.reload();
//alert(getCookie('url')+'-'+'<?php echo $time;?>');

   function getCookie(objName){
    var arrStr = document.cookie.split("; ");
    for(var i = 0;i < arrStr.length;i ++){
     var temp = arrStr[i].split("=");
     if(temp[0] == objName) return unescape(temp[1]);
    }
   }
</script>


, ,