[請益] 計數器防灌水
負責的圖書館網站有在作期刊點擊次數統計
(把IP、使用者ID、期刊名、時間等資訊寫入DB,再以程式統計)
一開始並沒有禁止短時間內重覆點擊
自從有單位要能統計個人使用次數後
就有灌水的情況出現
上個月實在太離譜了,有一個單位點擊次數爆增10倍多
看來不能不改了...
先想到用SESSION,程式檢查SESSION不存在才寫入log
不過這樣SESSION存在期間,點其它期刊也不會計次
所以又想到把期刊名放在SESSION裡
不過這樣交替點不同期刊還是能灌次數...
不能光看IP,因為來自同單位的USER都同IP
我的情況怎麼作比較好呢?
還有session能用函式訂有效時間長短嗎?
放一段log給各位看看可能比較容易瞭解:
id ip date time access_jname access_user
1500980114, 192.168.161.85, 20090616, 09:49, 期刊名太長略, 18-
1500980115, 192.168.161.85, 20090616, 09:49, 期刊名太長略, 18-
1500980148, 192.168.161.85, 20090616, 09:49, 期刊名太長略, 18-
1500980149, 192.168.161.85, 20090616, 09:49, 期刊名太長略, 18-
1500980151, 192.168.161.85, 20090616, 09:49, 期刊名太長略, 18-
1500980152, 192.168.161.85, 20090616, 09:49, 期刊名太長略, 18-262
1500980153, 192.168.161.85, 20090616, 09:49, 期刊名太長略, 18-262
1500980212, 192.168.161.85, 20090616, 09:49, 期刊名太長略, 18-262
1500980213, 192.168.161.85, 20090616, 09:49, 期刊名太長略, 18-262
1500980214, 192.168.161.85, 20090616, 09:49, 期刊名太長略, 18-262
1500980215, 192.168.161.85, 20090616, 09:49, 期刊名太長略, 18-
1500980216, 192.168.161.85, 20090616, 09:49, 期刊名太長略, 18-
1500980264, 192.168.161.85, 20090616, 09:49, 期刊名太長略, 18-
1500980265, 192.168.161.85, 20090616, 09:49, 期刊名太長略, 18-
1500980266, 192.168.161.85, 20090616, 09:49, 期刊名太長略, 18-
1500980267, 192.168.161.85, 20090616, 09:49, 期刊名太長略, 18-
已省略部分,114~267都是6/16 09:49點的
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 210.241.104.166
推
07/21 09:07, , 1F
07/21 09:07, 1F
→
07/21 09:08, , 2F
07/21 09:08, 2F
→
07/21 09:09, , 3F
07/21 09:09, 3F
→
07/21 09:09, , 4F
07/21 09:09, 4F
→
07/21 09:10, , 5F
07/21 09:10, 5F
→
07/21 09:10, , 6F
07/21 09:10, 6F
→
07/21 09:11, , 7F
07/21 09:11, 7F
→
07/21 09:12, , 8F
07/21 09:12, 8F
推
07/21 09:23, , 9F
07/21 09:23, 9F
→
07/21 09:23, , 10F
07/21 09:23, 10F
→
07/21 09:24, , 11F
07/21 09:24, 11F
推
07/21 09:25, , 12F
07/21 09:25, 12F
→
07/21 09:26, , 13F
07/21 09:26, 13F
→
07/21 09:26, , 14F
07/21 09:26, 14F
推
07/21 09:30, , 15F
07/21 09:30, 15F
→
07/21 09:30, , 16F
07/21 09:30, 16F
→
07/21 09:30, , 17F
07/21 09:30, 17F
推
07/21 09:33, , 18F
07/21 09:33, 18F
→
07/21 09:33, , 19F
07/21 09:33, 19F
→
07/21 09:34, , 20F
07/21 09:34, 20F
→
07/21 09:34, , 21F
07/21 09:34, 21F
→
07/21 09:35, , 22F
07/21 09:35, 22F
→
07/21 09:35, , 23F
07/21 09:35, 23F
推
07/21 09:36, , 24F
07/21 09:36, 24F
→
07/21 09:36, , 25F
07/21 09:36, 25F
→
07/21 09:37, , 26F
07/21 09:37, 26F
→
07/21 09:37, , 27F
07/21 09:37, 27F
→
07/21 11:20, , 28F
07/21 11:20, 28F
→
07/21 11:21, , 29F
07/21 11:21, 29F
※ 編輯: ThiefFan 來自: 210.241.104.166 (07/21 11:30)
→
07/21 11:30, , 30F
07/21 11:30, 30F
推
07/21 11:59, , 31F
07/21 11:59, 31F
推
07/21 12:38, , 32F
07/21 12:38, 32F
→
07/21 13:38, , 33F
07/21 13:38, 33F
→
07/21 13:38, , 34F
07/21 13:38, 34F
→
07/21 13:39, , 35F
07/21 13:39, 35F
→
07/22 11:55, , 36F
07/22 11:55, 36F
→
07/22 11:55, , 37F
07/22 11:55, 37F
→
07/22 11:59, , 38F
07/22 11:59, 38F
推
07/22 15:39, , 39F
07/22 15:39, 39F
推
07/22 15:41, , 40F
07/22 15:41, 40F
→
07/22 15:41, , 41F
07/22 15:41, 41F
→
07/22 16:22, , 42F
07/22 16:22, 42F
→
07/22 16:23, , 43F
07/22 16:23, 43F
→
01/19 09:15, , 44F
01/19 09:15, 44F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章