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 can be used to add CSS styles directly in the HTML tag?
type style class
<div style="width: 80%; border: 3px solid #888888;">Content</div>
Which CSS transform method distorts the HTML element in a given angle (including its content)?
translate() scale() skew()
#some_id {
  transform: skew(20deg, 25deg);
  -ms-transform: skew(20deg, 25deg);   /* IE 9 */
  -webkit-transform: skew(20deg, 25deg);   /* Safari and Chrome */
Click on the function which converts a Date object to a string.
indexOf() toString() getDate()
var rightnow = new Date();
alert( rightnow.toString() );
Which function applies a callback function to the elements of the given array?
array_merge() array_search() array_map()
$arr = arra("abc", "<p>xyz</p>", "<em>PHP</em>");
// apply the strip_tags() function to delete HTML tags from each array item
$arr = array_map("strip_tags", $arr);
Ajax Voting Script - Vote Up Down

Last accessed pages

  1. PHP PDO - exec (INSERT, UPDATE, DELETE) MySQL (13586)
  2. Get and Modify content of an Iframe (3438)
  3. Get and change IFrame content through a JavaScript script created in another IFrame (2901)
  4. Introduction to Adobe Flash (817)
  5. Bubble Tanks 3 (6647)

Top accessed pages

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