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条)

报告相同问题?

悬赏问题

  • ¥15 高价求中通快递查询接口
  • ¥15 解决一个加好友限制问题 或者有好的方案
  • ¥15 关于#java#的问题,请各位专家解答!
  • ¥15 急matlab编程仿真二阶震荡系统
  • ¥20 TEC-9的数据通路实验
  • ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
  • ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
  • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
  • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
  • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?