Info
Name | Rating System PHP AJAX and SQLite |
Market | codester.com |
Category | Polls |
Tags |
Changes in v1.2:
– Improved XML file creation.
– Two additional graphic versions.
This rating system is written in PHP. It uses AJAX, PHP session and SQLite. After clicking “the hand”, the vote is recorded in file-based database. Your site is not reloading. If you have already voted for this article / post, your vote can not be saved (in this PHP session). Tested in IE, Firefox and Chrome.
How to implement?
1. Download and unpack the zipped files. Select folder with graphic version, that you like, for example “rating_a”.
2. Then you must put the folder “gravedgRating” into folder with your website.
Your website must have the extension “.php”.
3. Put the following lines of code into your site:
a) The first line of the code of your page:
session_start ();
?>
b) In the “head” section:
c) In the “body” section, in places where voting should be visible:
$ ArticleID = “12345”;
include ‘gravedgRating/ratingJS.php’;
?>
That’s all.
See the pdf file how to implement, with image illustration and an example of the implementation, in folder “docs”.
Each time you calling the script, you must give another identifier (“$ articleID”). “12345” is an example identifier. You can do it in a loop, writing (for example) 10 posts from users.
The text displayed to the user, and path to your database, you can change in “rating.php” file.
There are nine different graphic versions of this script. They are compressed in nine different directories (“rating_a”, “rating_b” and so on…). Use the one that you like.
In addition, the database is stored the user’s IP and time of voting. You can see it using i.e. free program “sqliteAdmin” from Internet.