无限星辰工作室-客户无限互联网动力之源

标题: 简单的CC防护函数(PHP) [打印本页]

作者: crx349    时间: 2013-6-26 09:31
标题: 简单的CC防护函数(PHP)
  1. $P_S_T = $t_array[0] + $t_array[1];
  2. $timestamp = time();
  3. session_start();
  4. $ll_nowtime = $timestamp ;
  5. if ($_SESSION('ll_lasttime')==null){
  6. $ll_lasttime = $_SESSION['ll_lasttime'];
  7. $ll_times = $_SESSION['ll_times'] + 1;
  8. $_SESSION['ll_times'] = $ll_times;
  9. }else{
  10. $ll_lasttime = $ll_nowtime;
  11. $ll_times = 1;
  12. $_SESSION['ll_times'] = $ll_times;
  13. $_SESSION['ll_lasttime'] = $ll_lasttime;
  14. }
  15. if (($ll_nowtime - $ll_lasttime)<3){
  16. if ($ll_times>=5){
  17. header(sprintf("Location: %s",‘http://*.xmspace.net’));
  18. exit;
  19. }
  20. }else{
  21. $ll_times = 0;
  22. $_SESSION['ll_lasttime'] = $ll_nowtime;
  23. $_SESSION['ll_times'] = $ll_times;
  24. }
复制代码
3表示时间间隔,5表示刷新次数,超过设定值,立即跳转




欢迎光临 无限星辰工作室-客户无限互联网动力之源 (https://xmspace.net/) Powered by Discuz! X3.4