|
Posted by Andy Dingley on 06/28/07 12:13
On 28 Jun, 13:03, Arjun <arjunkuma...@gmail.com> wrote:
> Can anyone provide me with codes which will help me limit users from
> left/right clicking more than 2 times per day (or withing a time
> frame).
No, I won't do that, because it's a bad idea to do so.
I doubt that you have a good reason to disable clicking. There are
many reasons against doing such a thing, mainly because there are lots
of reasons to click and you shouldn't try to prevent most of them. If
you want to stop people saving images locally, then do that - don't
switch off clicking altogether.
It's also not a good idea to try and limit client-side behaviour,
because it's effectively impossible to do so. You can do it enough to
annoy casual users, you can't do it well or reliably enough to stop
"real image pirates" or whatever your bogeyman is.
* Think about what you really need to stop people doing.
* Protect against this by some server-side mechanism, where you have
some chance of making it work
* Never mess with users' user interface.
If you _really_ want to stop clicking like this, then write yourself a
click handler and hook it onto the page.
Have it check for a cookie called "ClicksToday" and if its value is
more than your cut-off, then return false to cancel the click.
If the cookie's value is less than this, then increment it and store
it again.
If the cookie isn't found, then create it as a persistent cookie for
the site or page and with an expiry that's midnight / 24 hours from
current. Set its value to 1.
Navigation:
[Reply to this message]
|