duanmajing9332 2011-03-25 20:10
浏览 67
已采纳

每30秒只有一个传出链接

I'm working on a website now with a lot of external links. All links are going through a PHP file called: out.php

So a normal external link would be something like: out.php?url=http://www.google.com

My question is how to prevent people from clicking multiple links at a time? I want them to click only one link in 30 seconds for example. If they click another link an error should be appear telling them to wait the rest for the seconds, before they can visit another page.

Using cookies is not an option, because they still can disable the cookies.

Thanks in advance for any help!

  • 写回答

2条回答 默认 最新

  • doudang2817 2011-03-25 20:14
    关注

    Save the url which was clicked somewhere (file, database, ...) and the timestamp when it was clicked last time. Then for every click check the timestamp of the given url (if exists). If it is inside the 30 seconds windows ignore the request, otherwise use the request and update the timestamp field. If you need to separate it for each user as well save the IP (or userid if you have), too.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题