Shockdot Posted June 12, 2012 Share Posted June 12, 2012 I'm creating a website for a client. The website is basically a huge phone book on local business'... I've created a like form system for various categories, such as Customer Service, Cleanliness, quality, and speed of service. The problem I'm having is that users are able to click the like button without restrictions.... Which is bad haha... I'm looking for a way that if a user likes one of the categories, it is logged and he can no longer like that category. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/264069-how-do-i-restrict-people-from-spamming-a-like-button/ Share on other sites More sharing options...
Drongo_III Posted June 12, 2012 Share Posted June 12, 2012 Would it be too simple to set a cookie ? Quote Link to comment https://forums.phpfreaks.com/topic/264069-how-do-i-restrict-people-from-spamming-a-like-button/#findComment-1353268 Share on other sites More sharing options...
floridaflatlander Posted June 12, 2012 Share Posted June 12, 2012 Would it be too simple to set a cookie ? That's what coppermine photo album does, sets a cookie for a vote on a photo. Quote Link to comment https://forums.phpfreaks.com/topic/264069-how-do-i-restrict-people-from-spamming-a-like-button/#findComment-1353271 Share on other sites More sharing options...
mrMarcus Posted June 12, 2012 Share Posted June 12, 2012 Could have condition where user's must also be logged in to "like" as user could simply delete the cookie and abuse the system. Check against IP/username. Quote Link to comment https://forums.phpfreaks.com/topic/264069-how-do-i-restrict-people-from-spamming-a-like-button/#findComment-1353275 Share on other sites More sharing options...
Shockdot Posted June 12, 2012 Author Share Posted June 12, 2012 Could have condition where user's must also be logged in to "like" as user could simply delete the cookie and abuse the system. Check against IP/username. Yah, that's what I wanted. The issue was storing the liked status properly, but I believe that I've resolved the issue.... Currently coding it now, I'll let you guys know haha. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/264069-how-do-i-restrict-people-from-spamming-a-like-button/#findComment-1353278 Share on other sites More sharing options...
shlumph Posted June 12, 2012 Share Posted June 12, 2012 As mrMarcus suggests, their username would probably be the best. If you want a way to do it where the user doesn't have to be logged in, I wouldn't uniquely identify them with just their IP address, though. NAT could mess this up. Quote Link to comment https://forums.phpfreaks.com/topic/264069-how-do-i-restrict-people-from-spamming-a-like-button/#findComment-1353279 Share on other sites More sharing options...
Shockdot Posted June 12, 2012 Author Share Posted June 12, 2012 As mrMarcus suggests, their username would probably be the best. If you want a way to do it where the user doesn't have to be logged in, I wouldn't uniquely identify them with just their IP address, though. NAT could mess this up. My client wants the user to be logged in or they can't like it. I got it working . Simply made another table that logged a username, the business they are liking, and has the 4 categories on it. When the user clicks the like button it adds the info to the table, if its already added it updates the appropriate category field, and if that field is already liked then it does not add an additional like to the business. Thanks guys! Quote Link to comment https://forums.phpfreaks.com/topic/264069-how-do-i-restrict-people-from-spamming-a-like-button/#findComment-1353284 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.