Php-mysql Course

This is a Free Voting Script that allow users to vote Up /Down (Plus /Minus) 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 are saved in a MySQL database, using MySQLi (or 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 per day.
It has been tested successfully on Mozilla Firefox, Internet Explorer, Google Chrome and Opera.
- Details about Installation and Settings you'll find in a "readme.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.

• To create a list which ranks the score of multiple voted items, based on highest score (or points), perform a MySQL Select in the "votitems" table. This table stores the voted items (in "id" column), Up votes (in "v_plus" column), and number of Down /Minus votes (in "v_minus" column).
Example:
SELECT id, (v_plus - v_minus) AS score FROM votitems ORDER BY score DESC LIMIT 10

• If you not put the "voting_mp" folder in the Root of your site, open the "voting.js" file (in "voting_mp" directory), and add the domain name to the value of the voting_mp variable; to use the absolute path.
Instead of:
var voting_mp ='/voting_mp/';
Edit to be:
var voting_mp ='http://domain_name/voting_mp/';

- 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

HTML
CSS
JavaScript
PHP-MySQL
Which meta tag provides a short description of the page?
<meta content="..."> <meta description="..."> <meta http-equiv="...">
<meta name="description" content="70-160 characters that describes the content of the page" />
Which CSS property is used to stop the wrapping effect of the "float"?
clear text-align position
#some_id {
  clear: both;
}
Click on the method which gets an array with all the elements in the document that have a specified tag name.
getElementsByName() getElementById() getElementsByTagName()
var divs = document.getElementsByTagName("div");
var nr_divs = divs.length;
alert(nr_divs);
Indicate the PHP function which returns the number of elements in array.
is_[) count() strlen()
$arr =[7, 8, "abc", 10);
$nri = count($arr);
echo $nri;        // 4
Ajax Voting Script - Vote Up Down

Last accessed pages

  1. SHA256 Encrypt hash in JavaScript (31348)
  2. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (141650)
  3. AJAX Course, free Lessons (19904)
  4. Other Free Courses (2690)
  5. HTML Course - Free Lessons (25952)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (374)
  2. CSS cursor property - Custom Cursors (68)
  3. PHP-MySQL free course, online tutorials PHP MySQL code (51)
  4. The Mastery of Love (48)
  5. CSS3 2D transforms (43)
Chat
Chat or leave a message for the other users
Full screenInchide