Home >Backend Development >PHP Tutorial >大型网站怎么防止刷新

大型网站怎么防止刷新

WBOY
WBOYOriginal
2016-06-23 14:07:52846browse

一个访问量上万的网站,当点击一篇文章后这文章的点击率加1,可是刷新一次页面,点击率就加一,怎么防止,我不会做


回复讨论(解决方案)

除非有个表……
把session id和一个时间段组合做个hash记录下来
下次有请求访问时,检查hash是否存在,不存在才+1

能给个代码吗,我刚接触php不太懂怎么弄

这有什么不好呢?不是就要点击率高吗?

营销手段---从点击率低的人中

那你就判定一下来源不就行了?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn