2FG Logo
Young Girl Dress Up

play in fullscreen mode
= 0 && isset($_POST[id])) { // insert rating into db $query = "update games set rated = rated + 1, rating = rating + '$_POST[rate]' where id = '$_POST[id]'"; mysql_query($query); // set cookie to prevent multiple ratings setcookie("rated_$_POST[id]", true, time()+84600); // setcookie("rated_$_POST[id]", true, 0, '/'); // get out of here header("Location: $_SERVER[HTTP_REFERER]"); exit(0); } elseif (isset($rating_id) && is_numeric($rating_id)) { // we're viewing something // increment the views first // mysql_query("update games set views = views + 1 where id = '$rating_id'"); $query = "select round(rating / rated, 2) as rating, rated from games use index (idx) where id = '$rating_id'"; $result = mysql_query($query); if (mysql_num_rows($result) == 0) return; // bail if (isset($_REQUEST["rated_$rating_id"])) $readonly = true; ?>
>        Thank you for your vote!
Not Yet Rated\n"; else print "Rating: ".mysql_result($result, 0, 'rating')." with ".mysql_result($result, 0, 'rated')." votes\n"; if (!$readonly) { ?>     Rate This Page:
1 2 3 4 5 6 7 8 9 10
Suckage Average Awesome