eddienotizzard
eddienotizzard

Reputation: 31

Refreshing pages too much

I've noticed in 4chan that if you refresh the page too much (e.g. filling out the form incorrectly too many times .etc) -- they show you the recaptcha page. I'm wondering how this is done, do they use an algorithm or something to decide what is suspicious behaviour? How would you about recording usage history in php (i.e. how would go about doing this in php)?

It would be most likely done using sessions right -- or would they store it in a database using IP address (unlikely due to dynamic IPs).

Upvotes: 3

Views: 208

Answers (2)

Eray
Eray

Reputation: 7128

I think, if you do this with $_SESSION[] it will be better than storing database. When browser window is closed, SESSION will be cleared

Upvotes: 1

Matt Asbury
Matt Asbury

Reputation: 5662

You could use a session to track what the last page someone visited was and if it was equal to the current page. You could then increment a counter to see how many times they hit the same page in a row and redirect if it was too often. You could also add in a timestamp to see how long ago they last visited the page which would be a small difference if they were hitting the refresh button.

Upvotes: 2

Related Questions