Web site design question – advanced programming?
I am interested in creating a voting function that would basically work like the thumbs up thumbs down on sides like Y!A or YouTube. Ideally this vote would result in an immediate update to change a net score and possibly set a cookie to prevent someone from voting for the same item multiple times.
I know how do do this using PHP and MySQL, but the results would not be displayed until the next time the page is refreshed. I would also like to avoid a page refresh between each vote. Basically I would like the person to be able to scroll down the page click to vote and be done with it.
I’m not asking for specific information about how to do this, just ideas to point me in the right direction. Would you do this with JavaScript or some other technology?
To have a thumbs up thumbs down voting system without refresh requires AJAX.
It is not "that" complicated and I will give you the solution, but it is going to take an hour or two.
Go to http://www.web2coders.com tomorrow or later today: I’ll put up a "Voting Script" in the free scripts section. It will be a Zip file to download (images, voting.css, index.php, voting.js, Sajax.php).
A lot of people have asked for this
I have implemented it in "www.namibiaanswers.com". Have a look!
you need to refresh just a portion of page ,
look for AJAX
AJAX is not a programming language it is just a technic that allows you to refresh part of page.
http://jquery.com/
References :
http://jquery.com/
To have a thumbs up thumbs down voting system without refresh requires AJAX.
It is not "that" complicated and I will give you the solution, but it is going to take an hour or two.
Go to http://www.web2coders.com tomorrow or later today: I’ll put up a "Voting Script" in the free scripts section. It will be a Zip file to download (images, voting.css, index.php, voting.js, Sajax.php).
A lot of people have asked for this
I have implemented it in "www.namibiaanswers.com". Have a look!
References :
The sites I’m running that include a ‘voting’ feature do indeed use AJAX technologies. Also, JQuery’s library functions so as to simplify the need to re-invent the wheel:
http://jquery.com/
If you plan on writing the code yourself, why not download something like the Drupal CMS, and the Voting API that provides this kind of support for a variety of contributed modules. Several modules that make use of that API are mentioned on its page.
http://drupal.org/
http://drupal.org/project/votingapi
Keep in mind these are all open source projects written entirely in PHP using MySQL (on most sites). Studying their code is something they encourage and costs you nothing!
References :
Here’s an article on jQuery for beginners.
http://www.cherrysave.com/programming/jquery-for-beginners-selectors-hierarchies-and-attributes-oh-my/#comments
References :
Just JR made you this applet.
Check out his site.
References :