Star rating system with JavaScript and PHP

screenshots Live Preview

Easy to use star rating system for your website, by pasting 1-2 lines of provided javascript you can display the system on your site and allow the users to rate your content (pages, articles, photos, products, etc), you simply provide an unique item to be rated, e.g Product19, Product20, etc.


- Very easy to integrate in your site, see "using the script" area for details.
- Loads and posts new votes without reloading the web page.
- Can be included in any html file type like html, htm, asp, php, etc.
- It saves data automatically in a plain file on server.
- Optionally it can also save data to a database.
- Easy to change stars by replacing the small images.
- Easy to customize looks and colors by editing existent CSS file.
- Can allow users to vote again after X seconds.
- Can also display half stars (or only full stars).
- You can define labels for each star clicked: good, bad, outstanding, etc.
- Easy to translate or change the texts.
- Ratings can also be displayed in read-only mode so users cannot post new votes
- You can set the total number of stars (usually 5 or 10) and can change this at any time without affecting the current vote results.


For this script to work correctly on your hosting environment, please ensure that the latter meets the following requirements:


If you have any pre-sales or support related questions for this application, please visit our helpdesk.

A simple, yet highly configurable, star rating system that seamlessly integrates in any site to offer a powerful user-rating functionality. - HotScripts, Editorial Team. Read full review >

Editor Review

A simple, yet highly configurable, star rating system that seamlessly integrates in any site to offer a powerful user-rating functionality. Read full review >

Bottom Line: Yes, I would recommend this to a friend

User Reviews 

Add/Edit Your Review
Average Member Rating: 3.21/5

Displaying 1-5 out of 8 reviews

  • the wording and instruction are not clear. it seems that the indtructions are for different product.. but close enuff

  • Nice tutorial very good to learn i found a tutorial on same topic star rating system and it is also very good to understand with demo also i also recommend that have a look

  • If you want to see how this script works, go to and select any photo. This script is excellent! I tested saving the data as text file and MySQL. Both works. I really can't think of anything where the script can be further improved. PROs: ============== 1) It allows specifying a product ID by adding rating_id = 'xxxxxx' to your webpage. So you can call the same rating record under different pages but still showing the same result. In my case, I have English and Thai versions for each of my photo page. If you click on the switch language icon (the flag icon on top of the website), you will see how it works. 2) Very neat design. 3) You may specify the number of stars and text (such as Terrible, Poor, Average, Good! and Excellent!!!) up to 10 stars. I use 5 stars. 4) The script does NOT call externally (such as calling a Javascripts or file at the developer's website). 5) It let you specify (in seconds) how long the voter can re-vote. By default it is a year. CONs: ============== Nil IMPORTANT NOTES: ============== If the star rating system does not show up (instead, it shows only the "loading" text) on your webpage, it might have been blocked by your server's security feature. In my case, I am using ModSecurity and the standard OWASP ModSecurity Core Rule Set. - 981261 SQL Injection Attack Detected via LibInjection. Once I added Rule ID 981261 to the whitelist for my domain name (I added this under cPanel/WHM >> ConfigServer ModSec Control), the script works flawlessly.

  • It uses document.write() to create its container element. If you have any kind of dynamic setup, you'll have to rewrite that portion of the client-side code, since document.write() isn't supposed to be used after the DOM has loaded. Furthermore, you'll have to add some isset() calls in the back-end PHP code since if you don't, you'll get at least 3 PHP warnings showing up on the output page. Other than that, when you invent your own client-side setup for it, so that it will smoothly create its container, it's pretty decent. The quality of the design of the code is very novice-level. Inconsistent code style, indentation is ridiculous, etc. The only saving grace is that the core algorithm works, so you only have to do some cleanup work around it, basically to fix the issues I've already mentioned.

  • This script works as easy as described!! Great product, easy to configure.

See all 8 reviews for Star rating system with JavaScript and PHP