dozpv84422 2009-02-05 00:23
浏览 14
已采纳

你怎么能解决在PHP刷新时重新发送http引用数据?

I have a IN/OUT ratio hit counting system on my site. When a user is sent to my site, I grab the referrer, strip the domain, look up the domain and +1 to hits_in. Very simple. What I discovered thou is, if a user refreshes the page, the referrer is resent to the site, and it counts it as another +1. Whats even worse is that if user clicks on some link on the site, and then hits BACK to go to the original page, the referrer is resent, and it counts as another +1. So if a foreign site sends me 1 user, who clicks on a video link, views the video, hits BACK in his browser, and then does this 3 times, it will count as if a site sent me 4 users when in fact its just 1.

Any way I could prevent the 2 examples from happening without actually logging all IPs and checking access times for each IP before doing the +1.

  • 写回答

3条回答 默认 最新

  • dongzhao1865 2009-02-05 00:30
    关注

    I am not expert in this, but can't you just use sessions. temporarily store referred url into session, so if user clicks back than check if users session contains referral site. if it contains don't count.

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

报告相同问题?

悬赏问题

  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效
  • ¥100 连续两帧图像高速减法
  • ¥15 如何绘制动力学系统的相图
  • ¥15 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作