0

Possible Duplicate:
Stack Overflow / reddit voting system in php

How do voting systems, like the one here at SO, work? I would like to implement a voting system on my web page (coded in php), but dont want to have to force the user to post a form to vote and update the database. I would like it so when a user clicks a thumbs up, on a comment as an example, the database would automatically update the "reputation" of that comment. Is there any way to accomplish this in php? What would you guys reccomend?

Community
  • 1
  • 1
Petey B
  • 11,439
  • 25
  • 81
  • 101
  • 1
    Duplicate of http://stackoverflow.com/questions/490969/stack-overflow-reddit-voting-system-in-php – Paul Dixon Aug 06 '09 at 16:04
  • The following links are moved here from link-pnly answers which might get deleted soon: Shoban wrote: Check this tutorial: http://www.technabled.com/2009/02/reddit-style-voting-with-php-mysql-and.html ; Max wrote: You need to use AJAX. Read http://symfony.com/legacy/doc/askeet/1_0/en/8 to have an example on how to implement a digg-like voting functionality. – Alexander Zhak Apr 18 '15 at 15:17

2 Answers2

2

The basic technique is called Ajax. You can't exactly "do it in PHP", though PHP can be used as part of the process. The Ajax code itself is in JavaScript. More specifically, SO uses the Ajax support built into jQuery.

chaos
  • 122,029
  • 33
  • 303
  • 309
1

Read up on Ajax. Essentially, you'd be using Javascript to handle the form submissions and get back responses in the background, then modifying the page based on that.

matthock
  • 629
  • 1
  • 4
  • 15