1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2016
    Rep Power

    Question Creating a 5-star rating tool on my website


    I want to create some form of 5-star rating tool on my website, but I have found that it is not as simple as I first thought.

    I was able to create a widget for the website itself, but as I'm a complete novice, I have become stuck now it has come to recording the data provided through the widget.

    Any help as to my next step would be really beneficial, I've read that I need to use PHP and MySQL, but these are both completely alien to me so I'm at a bit of a dead end.

    Has anyone been able to implement this type of thing on their website? and if so, how easy is it?


  2. #2
  3. Lord of the Dance
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Oct 2003
    Rep Power
    PHP and MySQL is not the only language, you have to see what your host supports.

    That said, if you don't know PHP, how did you create you website?
    If you already use some kind of a CMS/template system, there might be a plug-in for adding that functionality.
    Can you tell more about the widget you have found?

    If you want to learn PHP and/or MySQL, there are no other options than starting with the basic tutorials and work your way up.
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2016
    Rep Power
    I agree with MrFujin - you will need to decide on a technology to use and commit to learning the relevant parts to complete your development. Or pay somebody to do it for you, but learning is more fun

    This is basically how your app needs to work:

    • You have the basic CSS and Star icons designed
    • A user needs to be able to sumbit the rating when a start is clicked - for this you can use jQuery ajax() or post() which which will send the ID of the rating (be it a unique ID or page URL or something), plus the rating number as two seperate variables.
    • PHP would then pick this up via the submitted data ($_POST), and save that content to the Database using MySQL (MySQLi or PDO).
    • jQuery would then need to add a class to the rating <div> to disable the links so further rating isn't available, or if you have additional code PHP-side, you could allow your users to change the rating after they've voted.

    As a side, remember there are many projects to help you with this, such as: Star Rating Demo - Kartik
    Thank You :: John Davies, || Learn how to install WordPress in 5 minutes
    Belira - Web Hosting, Domain Names, Reseller Hosting, VPS Hosting & Dedicated Servers
    Reliable & Professional WordPress Hosting, Joomla Hosting, e-Commerce Website Hosting
    cPanel, Domain Names, SSL Certificates, with A Close & Personal Support 24/7/365

IMN logo majestic logo threadwatch logo seochat tools logo