I made this simple ajax star rating for my latest poject. And now i want to share it to you. Let’s start it :D.
Step 1 : CSS Star Rater
First thing is the star rater. I got this cool ‘css star rater’ from http://www.komodomedia.com/ . I assumed that we already understood how to use it, so we will not talk too much about this ‘css star rater’.
Step 2 : Create MySQL table
Next is create table (using MySQL) to store the data. You can copy the script below
[sourcecode language=’sql’]
CREATE TABLE IF NOT EXISTS vote
(
counter
int(8) NOT NULL default ‘0’,
value
int(8) NOT NULL default ‘0’
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
[/sourcecode]
Step 3 : PHP
After finished create table, then we can start create some php code to handle input, update and retrieve data from the database, here is the code. I added some important comment in it
[sourcecode language=’php’]
[/sourcecode]
Step 4 : JavaScript
Next thing is javascript code. Below is the code, you can put this code between <head> tag or put it in separated javascript file.
[sourcecode language=’jscript’]
[/sourcecode]
Don’t forget to link the jquery library into your document
[sourcecode language=’jscript’]
[/sourcecode]
Step 5 : Put it all together
Put your css, javascript in one html
[sourcecode language=’html’]
Star Rater
[/sourcecode]
That’s it! :D. You can add some modification like notification, or loader while processing.
– Download zip file jQuery Tutorial : Simple ajax star rating with php (12642)
This article inspired by http://www.yvoschaap.com/
Pingback: jQuery Tutorial : Simple ajax star rating with php | Ronggur …()
Pingback: jQuery Tutorial : Simple ajax star rating with php | pc-aras()
Pingback: jQuery Tutorial : Simple ajax star rating with php | MySandbox()
Pingback: 4 x 5 Star Rating Tutorial With jQuery In The Hot Seat « jQuery Fun - Having fun & making plugins()
Pingback: Javascript & PHP Star Rating Script | bgallz.org | Web coding & design tutorials, scripts, resources and more.()
Pingback: Hookah Experience()
Pingback: more resources()