PHP Classes

Star rating: Update votes and display rated content with stars

Recommend this page to a friend!
  Info   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 61%Total: 4,110 All time: 747 This week: 148Up
Version License PHP version Categories
ajax_star_rating 1.1The PHP License5.1.4PHP 5, Content management, AJAX


This class can be used to update user votes and display rated content with star images.

It can store in a MySQL database the ratings given by each user that votes on content keeping track of the IP addresses of the computers from which each user votes.

The class shows a row of stars to let the user vote on the content. Votes are submitted to the server via AJAX.

It can also display the stars that correspond to the current average of votes from all users of different IP addresses.

Picture of Sudhir Chauhan
Name: Sudhir Chauhan <contact>
Classes: 5 packages by
Country: India India
Age: 45
All time rank: 17610 in India India
Week rank: 405 Down27 in India India Down


1)update database schema 2)add database creadentions in the 3)Since this is user id based create $_SESSION['USERID'] = 'sudhir'; session variable and remove the hardcoded variable form

  Files folder image Files  
File Role Description
Accessible without login Plain text file readme.txt Doc. steps to use this example
Accessible without login Plain text file stars.css Data stylesheet used to create stars
Accessible without login Image file star_rating.gif Icon gif image used to create stars using css
Accessible without login Plain text file rpc.php Example the file used by ajax to send request to rating manage
Accessible without login Plain text file db.sql Data database schema contains table structure and example id
Accessible without login Plain text file js.js Data the file contains ajax code and other java script code that is responsible for changing start status
Plain text file Class file contains database class and rating class handles all functionality of star rating
Accessible without login Plain text file index.php Example the file used to run example

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:747
This week:148Up
User Ratings User Comments (2)
 All time