Hey, I've been trying to find a good Ajax/php five star rating script for my site, I have tried a bunch but I really like this one:
You see, my site has a points system, so the user gets 1 point for every item they rate. So I need to include a file called "1up.php", the contents of the file are pretty simple:
That code works fine when i just view the file 1up.php, but i need it so that they only get the points when the rate the item.
It shouldnt be hard just a simple "include ("1up.php");"
but i cant figure out where to put it.
I will pay $300 frih for this very simple fix
| Code: |
|
http://www.masugadesign.com/the-lab/scripts/unobtrusive-ajax-star-rating-bar/ |
You see, my site has a points system, so the user gets 1 point for every item they rate. So I need to include a file called "1up.php", the contents of the file are pretty simple:
| Code: |
|
<?php include("config.php"); include("include/session.php"); // the point addition system if($session->logged_in){ $username = $session->username; // Input/gather data $gettutorial = mysql_query("SELECT * FROM users WHERE username = '$username' ") or die (mysql_error()); $sqlpoint = mysql_query("SELECT point FROM users WHERE username = '$username' ") or die (mysql_error()); $tutorial= mysql_fetch_array($gettutorial); // begin adding points and stuff $points = $tutorial['point'] + 1; mysql_query("UPDATE users SET point='$points' WHERE username='$username'") or die (mysql_error()); mysql_free_result($gettutorial); } else{} ?> |
That code works fine when i just view the file 1up.php, but i need it so that they only get the points when the rate the item.
It shouldnt be hard just a simple "include ("1up.php");"
but i cant figure out where to put it.
I will pay $300 frih for this very simple fix
