Ajax Rating System: Create Simple Ajax Rating System using jQuery AJAX and PHP.
Simply programmed, CSS based stylish Ajax rating system which you can use any where to put a stylish jquery effect based rating system.
Table Structure:
CREATE TABLE `ajax_ratings` ( `id` int(11) NOT NULL auto_increment, `image_id` int(11) NOT NULL default '0', `rating` int(11) NOT NULL default '0', `users_ip` varchar(200) NOT NULL default '', PRIMARY KEY (`id`) )
Javascript Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | $(document).ready(function(){ $('#loader').hide(); $('#inner').children().click(function(){ var a = $(this).attr("id"); $.post("rating.php?value="+a, { }, function(response){ $('#inner').fadeOut(); $('#inner').html(unescape(response)); $('#inner').fadeIn(); setTimeout("hideMesg();", 2000); }); }); }); function hideMesg(){ $('.rating_message').fadeOut(); $.post("rating.php?show=1", { }, function(response){ $('#inner').html(unescape(response)); $('#inner').fadeIn('slow'); }); } |
PHP Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | include("dbcon.php"); $users_ip = $_SERVER['REMOTE_ADDR']; if($_REQUEST['value']) { $id = $_REQUEST['value']; $result = mysql_query("select users_ip from ratings where users_ip='$users_ip'"); $num = mysql_num_rows($result); if($num==0) { $query = "insert into ratings (rating,users_ip) values ('$id','$users_ip')"; mysql_query( $query); $result=mysql_query("select sum(rating) as rating from ratings"); $row=mysql_fetch_array($result); $rating=$row['rating']; $quer = mysql_query("select rating from ratings"); $all_result = mysql_fetch_assoc($quer); $rows_num = mysql_num_rows($quer); if($rows_num > 0){ $get_rating = floor($rating/$rows_num); $rem = 5 - $get_rating; } } } |
Related Posts :
22 to “Ajax Rating System: Create Simple Ajax Rating System using jQuery AJAX and PHP.”
Post comment
Who Am I

Zeeshan Rasool
Software Engineer - PHP
Lahore - Pakistan
Skype: zeeshan-rasool
gTalk: zishan.rasool85
Categories
- AJAX (24)
- Codeigniter (16)
- CSS (7)
- Facebook (8)
- Joomla (1)
- JQuery (34)
- Miscellaneous (3)
- Mootools (1)
- MySQL (4)
- PHP (43)
- SEO (2)
- Technology (6)
- Twitter (1)
- Web Development (58)
Archives
- August 2010 (7)
- July 2010 (9)
- June 2010 (9)
- May 2010 (8)
- April 2010 (17)
- March 2010 (13)
- February 2010 (3)
Tags
99points
adobe
AJAX
ajax pagination
ajax rating
ajax tutorial
captcha
Codeigniter
codeigniter 2.0
codeigniter recaptcha
CSS
css tutorials
curl
dreamweaver cs5
Facebook
Facebook. PHP. JQuery
facebox
farmville
ffmpeg
flv
google api
hacking
image gallery
Joomla
JQuery
jQuery Sliding
Jquery tutorial
mafia war
Mootools
MySQL
Payment
PHP
php curl
Poll System
recaptcha
RSS Feed
SEO
simplepie
socail networking
ssl
Tutorials
Twitter
Web
XSS
youtube
Comments
- Super Ajax Polling/Voting System using JQuery, Ajax, PHP and MySQL | Bodeezy Bux on Ajax Rating System: Create Simple Ajax Rating System using jQuery AJAX and PHP.
- Adam on Create Animated Tabs using JQuery and CSS.
- ZeeShaN on Reloaded: Facebook Style Wall Posting and Comments System using jQuery PHP and Ajax.
- Marco on Reloaded: Facebook Style Wall Posting and Comments System using jQuery PHP and Ajax.
- Facebook Style Wall Posting and Comments System using jQuery PHP and Ajax | Programmer Heaven on Facebook Style TextArea with Wall Posting Script using jQuery PHP and Ajax.
ZeeShaN






[...] This post was mentioned on Twitter by 99_Points, 99_Points. 99_Points said: Ajax Rating System: Create Simple Ajax Rating System using jQuery AJAX and PHP. http://dlvr.it/18p7B [...]
[...] Ajax Rating System: Create Simple Ajax Rating System using j [...]
[...] http://www.99points.info/2010/05/ajax-rating-system-create-simple-ajax-rating-system-using-jquery-aj... [...]
[...] Ajax Rating System: Create Simple Ajax Rating System using jQuery AJAX and PHP. Fresh Demo [...]
Ajax Rating System: Create Simple Ajax Rating System using jQuery AJAX and PHP. Fresh Demo…
Simply programmed, CSS based stylish Ajax rating system which you can use any where to put a stylish jquery effect based rating system. based…
[...] http://www.99points.info/2010/05/ajax-rating-system-create-simple-ajax-rating-system-using-jquery-aj... [...]
[...] Ajax Rating System: Create Simple Ajax Rating System using jQuery AJAX and PHP [...]
[...] Ajax Rating System: Create Simple Ajax Rating System using jQuery AJAX and PHP [...]
[...] Ajax Rating System: Create Simple Ajax Rating System using jQuery AJAX and PHP [...]
There is a mistake in your MySQL-Tablecode:
You have to change the name “ajax_ratings” to “ratings” and it will works well:
CREATE TABLE `ratings` (
`id` int(11) NOT NULL auto_increment,
`image_id` int(11) NOT NULL default ‘0′,
`rating` int(11) NOT NULL default ‘0′,
`users_ip` varchar(200) NOT NULL default ”,
PRIMARY KEY (`id`)
)
[...] Ajax Rating System: Create Simple Ajax Rating System using jQuery AJAX and PHP [...]
[...] Ajax Rating System: Create Simple Ajax Rating System using jQuery AJAX and PHP. [...]
Can you please reupload the source files? uploading says you have reached the limit.
Thankyou
Hi, Michael, Ok Please check again now.
this is very nice, it works excellent. rate.php have a syntax error, must be replace ratings with rating from the line 40 (“select sum(ratings) as rating from ratings”)
@ index.php
my bad, I renamed
[...] system or Voting system is very common in web sites. Voting can be about your site or blog or some other thing just to get [...]
[...] is another Rating System and Im sure you can get many awesome rating and voting script at 99Point.info I used animate() [...]
[...] tutorial in Rating System series is here for you. It is a stylish and animated rating system I created many Ajax based Rating [...]
[...] tutorial in Rating System series is here for you. It is a stylish and animated rating system I created many Ajax based Rating [...]
[...] tutorial in Rating System series is here for you. It is a stylish and animated rating system I created many Ajax based Rating [...]
[...] system or Voting system is very common in web sites. Voting can be about your site or blog or some other thing just to get [...]