Hi,
I got a 5 star rating script on my site here: http://rewards.yourpshome.net
And after a server update from plesk 10 to plesk 11 the script no longer does its mouse over action so users can not rate items.
It’s still pulling the right data from the mysql database its just the voting part no longer works.
Here is the full php code below, help is really welcome because I’m not a php coder.
Thank you.
[php]<?php
require_once(‘config2.php’);
mysql_connect($db_server, $db_username, $db_password) or die(mysql_error());
mysql_select_db($db_database) or die(mysql_error());
$div_id = isset( $_GET[‘id’] )? $_GET[‘id’]: false;
$rating = isset( $_GET[‘rating’] )? $_GET[‘rating’]: false;
$stars = isset( $_GET[‘stars’] )? $_GET[‘stars’]: false;
$report = isset( $_GET[‘report’] )? $_GET[‘report’]: false;
if($rating){
//Check that this person hasn’t already left a rating
$result = mysql_query(“SELECT id FROM ratings WHERE div_id = '” . $div_id . “’ AND ip = '” . $_SERVER[‘REMOTE_ADDR’] . “’”) or die(mysql_error());
$row = mysql_fetch_array( $result );
if(!$row[‘id’]){
$result = mysql_query(“INSERT INTO ratings (rating,div_id,ip) VALUES(’” . $rating . “’,’” . $div_id . “’,’” . $_SERVER[‘REMOTE_ADDR’] . “’)”) or die(mysql_error()); if($result){ $report = “<span style=“color: green;”> You rated this: $rating”; }
} else {
$report = “<span style=“color: red;”> You have already rated this.”;
}
}
?>
- <? echo $stars; ?>