| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Jan 2007
Posts: 207
![]() | Earn $5 - Limiting users clicking to once every 24 hrs. Basically, if a user goes to proxy.php?id=73 on my site, it'll update the visits out counter for that link id by adding 1, so it adds 1 each time it is clicked. However, that can obviously be cheated by someone clicking it 10 times in like 10 seconds and easily making the links out go to 10. I want to like, let users click proxy.php?id=whatever as many times as they want, but only unique clicks are counted, so if i clicked a link 10 times, the links out for that id would go up 1, and not 10 like it does currently. PHP Code: $5 to anyone who does it for me. |
| |
| | #2 (permalink) |
| NamePros Regular Join Date: Oct 2005 Location: Portugal
Posts: 800
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | check this : http://www.phpfreaks.com/quickcode/U...Counter/52.php it's very basic but it will get the job done, if you want something working with db check: http://inobscuro.com/tutorials/read/30/ hope it helps
__________________ Joćo Fernandes Silva |
| |
| | #4 (permalink) |
| Account Closed Join Date: Feb 2007
Posts: 156
![]() | yeah its easy i suppose you just check and remember ip and check if you had the same ip in the last 10 minutes ? nothing special. basically you get the user's ip and put it in the stack. next time you check you remove old entries and check the users ip against what's left in the stack |
| |
| | #6 (permalink) |
| Account Closed Join Date: Aug 2006 Location: Under a Bridge
Posts: 200
![]() ![]() | |
| |
| | #7 (permalink) |
| New Member Join Date: Mar 2007
Posts: 3
![]() | The solution by klavixs is cool, but what if the user has forbidden cookies? Or not forbidden, but he can delete the cookie and click again? I would suggest logging user clicks to a database (based on user's IP address) instead. |
| |
| | #8 (permalink) |
| NamePros Member Join Date: Sep 2006
Posts: 97
![]() | IP addresses can easily be changed as well. All you have to do is have a few proxies up in multiple windows and just click away. Proxies can also block cookies, making tracking by cookie less than perfect as well. A good compromise would be to plant a cookie with a unique id (md5(rand()) or something) when the person visits the page with the link and not allow the click if it doesn't exist. You can match the identifier with an IP range rather than an address so that people with dynamic IPs can't cheat the system. This weeds out the people who have cookies disabled. People can still clear out their cookies afterward and use a proxy to get a fresh cookie, but honestly there really isn't much you can do about that. Even banning proxy users by domain or IP wouldn't be perfect since new ones pop up everyday.
__________________ Paid Surveys |
| |