Hey everyone, I've been searching the web for awhile now trying to find a tutorial on making a click counter that registers clicks and saves them so that on a refresh they don't get reset. I also want it to add the count in real time (using ajax). I also want it to keep a user from clicking more than once on the same button. Here is a example of exactly what I want... http://www.twitrcovers.com/ Notice under each image is a counter that you can only vote or click on once. Is there a tutorial out there for this? I'm not very advanced when it comes to javascript and ajax (i'm front end guy so i'm used to css, html, and php) Any help would be great, thanks!
The problem isn't your lack of knowledge of AJAX, it's your lack of knowledge of programming. On a click, check (using AJAX) whether this user has clicked on this button. If not, tell the server (via AJAX) to increment the count for this button and to mark this user as having clicked on this button. (You can use the user's IP address ad "this user". It's not guaranteed, but it's about the best you can do on the web. Sending the user a cookie would also work, but if the user has cookies disabled or blocked, it won't.) Use the database to store the data. As far as an AJAX tutorial, just search for ajax tutorial - there are thousands of them. (Using jQuery, if you're already using it or if you want to add it, makes AJAX almost trivial, but writing AJAX code manually isn't much work.) You'll also have to learn Javascript, since that's the browser side of AJAX. (PHP is the server side.)