In fact, I don't think you probably really care if somebody clicks on it a hundred times - you just don't want the click to count. The way I've done stuff like this in the past is to simply create a database table, which logs the IP address and date/time of the click, and then just read the table before you add to whatever counter you're incrementing for your "like button," to make sure that the same IP hasn't clicked the button more than once in a given period.
Of course, if your users have user-names then it would be easy enough to just flag them in a database table as having "liked" whatever ... but then I don't suppose you'd be asking the question in the first instance if they had user-names.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||