This is a Free Voting Script that allow users to vote Up /Down on content, or to simple add and display points /votes for images, articles, videos, games, or any element in pages of your web site.
This Voting Script is made using Ajax technology, with JavaScript and PHP (with OOP), it can be included in any page (".html", or ".php"), but the server must run PHP.
The votes for each element can be saved in TXT files on the server, or in a MySQL database (using PDO).
The voted item, the number of the day, and the user (name or IP) are saved on the server, and cookies, so, the user can vote again the next day.
You can use the script to add rating system to one or more elements in a web page.
If you have a register /login script in your web site, you can set this Voting Script to allow only the logged users to vote. By default, all the visitors can vote an element once to 24 hours.
It has been tested successfully on Mozilla Firefox, Internet Explorer, Google Chrome and Opera.
- Details about Installation and Settings you'll find in a "Read.html" file, in the archive with the script.

• To Download it, click: Ajax-PHP Voting Script - Vote Up /Down.

Demo (here's an example with the three models of voting system that you can create with this script):
Free Vote Up /Down.
Vote Up /Down (or Plus /Minus), that shows Total Votes, and Current Rating. The vote can be Up (increase), or Down (decrease).
Free Up /Down Voting Script.
Up /Down (or Plus /Minus) vote system, that shows Current Rating, and the Number of Up and Down votes.
Simple Voting Script.
Simple vote to add /show points.

• If the votes are saved in MySQL database:
To create a list which ranks the score of multiple voted items, based on highest score (or points), perform a MySQL Select in the "voting" table. This table stores the voted items (in "item" column), total points (in "vote" column), and number of votes (in "nvotes" column).
SELECT `item`, `vote`, (`vote` / `nvotes`) AS `score` FROM `voting` ORDER BY (`vote` / `nvotes`) DESC LIMIT 10

• If you want to use this Voting Script in pages that are in different folders, open the "voting.js" file (in "votingfiles" directory), and add the domain name to the value of the votingfiles variable (line 6); to use the absolute path.
Instead of:
var votingfiles = 'votingfiles/';
Edit to be:
var votingfiles = 'http://domain_name/votingfiles/';

- Also, be sure to have in each page the correct path to the "voting.css", and "voting.js" files, included in the <head> area of the HTML code.

Daily Test with Code Example

Which attribute indicates that an input field must be filled out before submitting?
required="required" autofocus="autofocus" placeholder="text"
<input type="text" name="name1" required="required" />
Which CSS method increases or decreases the size of the HTML element (including its content)?
translate() scale() skew()
#some_id:hover {
  transform: scale(2, 1.5);
  -ms-transform: scale(2, 1.5);    /* IE 9 */
  -moz-transform: scale(2, 1.5);   /* Firefox */
Click on the Date object method that returns the day of the month.
setDate() getMonth() getDate()
var rightnow = new Date();
var day = rightnow.getDate();
Which function is used to upload a file on server?
is_file() move_uploaded_file() fopen()
if(move_uploaded_file($_FILES["field_name"]["tmp_name"], "dir/file_name")) {
  echo "The file succesfully uploaded";
Ajax Voting Script - Vote Up Down

Last accessed pages

  1. Get the value of the selected /checked checkboxes in a form (4274)
  2. JS Date Object (123)
  3. SHA1 Encrypt data in JavaScript (496)
  4. Execute JavaScript scripts loaded via AJAX (781)
  5. CSS Course - Free lessons (1620)

Top accessed pages

  1. PHP-MySQL free course, online tutorials PHP MySQL code (7873)
  2. Courses Web: PHP-MySQL JavaScript Ajax HTML CSS Flash-AS3 (7661)
  3. Get Attribute (ID, Class, Name, Title, Src) with jQuery (7365)
  4. PHP Chat Script (6757)
  5. PHP PDO - exec (INSERT, UPDATE, DELETE) MySQL (6727)