php防止刷新重复下载文件

mac2022-06-30  86

在超链接中增加随机数。

<a href="./index.php?module=operation&action=download&url=D:\WW\WlequPhone/active_code/2015-05-29-18-09-21.txt&time=27193">文件下载</a>

 

服务端

 

#接受随机数

$time=$_GET['time'];

#判断session中是否存在这个随机数了 if($time!=$_SESSION['time']){

    #第一次的时候保存到session中     $_SESSION['time']=$time;

      #coding ....

}

转载于:https://www.cnblogs.com/hgj123/p/4539322.html

相关资源:防止刷新后退重复提交
最新回复(0)