PHP:如何设置“最近访问”算得更好
当用户登录时,我的主页上有“您最近的 5 次访问”。它工作得很好,没有任何问题。
但后来我想改变它。我不知道应该如何做到这一点,但不知何故,一次只计算用户 1 次,而不是例如,如果他访问/刷新您的个人资料,则计算 10 次。
那么我应该用时间检查器来做到这一点吗?它应该在多长时间内只计数 1?秒数应该在什么时候计算?我需要一些想法,因为我不知道我是否应该让它每 10 分钟计数 1 次或每 1 分钟计数 1 次。
所以一个好的解决方案/给出一个好的现实的分钟提示将回答这个问题。
I have "Your latest 5 visits" at the home page of the user when he logs on. It works great without any problem.
But then i want to change it. I dont know how i should do this, but someway somehow only count the user 1 time at the time, and not e.g 10 times if he visits/refresh your profile.
So should i do this with a time checker? And for how long should it only count 1? When should second count? I need some idea for this, as I dont know if i should make it count 1 time per 10 minutes or 1 time per 1 minute..
So a good solution/giving a good realistic minute tip will answer the question.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有许多关于“您的上次访问”的教程
http://www.tizag.com/ phpT/phpcookies.php
There are a number of tutorials about 'Your Last Visit'
http://www.tizag.com/phpT/phpcookies.php