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 HTML5 tag can be used to embed an external application (SWF, PDF) in web page?
<mark> <embed> <canvas>
<embed src="flash_game.swf" width="450" height="350" />
Which CSS pseudo-element adds a special style to the first line of a text?
:first-letter :before :first-line
#id:first-line {
  font-weight: bold;
  color: blue;
}
Click on the window object property which gets or sets the URL of current page.
window.location window.self window.status
var url = window.location;
alert(url);
Indicate the PHP function used to get the contents of a file or page and store it into a string.
fopen() file_put_contents() file_get_contents()
$homepage = file_get_contents("http://coursesweb.net/");
echo $homepage;
Ajax Voting Script - Vote Up Down

Last accessed pages

  1. Snap to Objects and Snap Align (2880)
  2. Highlight Images on click (6765)
  3. innerHTML and outerHTML to Get and Replace HTML content (30639)
  4. PHP Unzipper - Extract Zip, Rar Archives (32334)
  5. Textarea with buttons to format text, colors and smiles (5283)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (352)
  2. CSS cursor property - Custom Cursors (41)
  3. The Mastery of Love (39)
  4. PHP-MySQL free course, online tutorials PHP MySQL code (34)
  5. Read Excel file data in PHP - PhpExcelReader (31)