this is the rating code
this is in the genproc.php
I am using this sql
--
-- Table structure for table `ibwf_urate`
--
CREATE TABLE IF NOT EXISTS `ibwf_urate` (
`id` int(100) NOT NULL AUTO_INCREMENT,
`rate` int(100) NOT NULL DEFAULT '0',
`byuid` int(100) NOT NULL DEFAULT '0',
`ratedid` int(100) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
--
-- Dumping data for table `ibwf_urate`
--
I would like to show the rating percentage and how many people rates. But cant do it. Please help. Please.
PHP Code:
echo "<select name=\"rate\" value=\"1\">";
echo "<option value=\"1\">1</option>";
echo "<option value=\"2\">2</option>";
echo "<option value=\"3\">3</option>";
echo "<option value=\"4\">4</option>";
echo "<option value=\"5\">5</option>";
echo "<option value=\"6\">6</option>";
echo "<option value=\"7\">7</option>";
echo "<option value=\"8\">8</option>";
echo "<option value=\"9\">9</option>";
echo "<option value=\"10\">10</option>";
echo "</select><br/>";
echo "<anchor>Rate $whonick";
echo "<go href=\"genproc.php?action=userrate&sid=$sid&who=$who\" method=\"post\">";
echo "<postfield name=\"rate\" value=\"$(rate)\"/>";
echo "</go></anchor>";
PHP Code:
////////////////////////////////////////////////////////////////USER RATE
////////////////////////////////////////////////////////////////USER RATE
else if($action=="userrate")
{
$rate = $_POST["rate"];
if ($uid==$who)
{
echo "<card id=\"main\" title=\"Rate User\">";
echo "<p align=\"center\">";
echo "You Cant Rate Yourself Silly<br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">";
echo "Main Page</a><br/>";
echo "</p></card>";
}
echo "<card id=\"main\" title=\"Rate User\">";
echo "<p align=\"center\">";
$uid = getuid_sid($sid);
$who = $_GET["who"];
$res = mysql_query("INSERT INTO ibwf_urate SET ratedid='".$who."', rate='".$rate."', byuid='".$uid."'");
if($res)
{
echo "rated successfully<br/>";
}else {
echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You have rated this user before<br/>";
}
echo "<p align=\"center\">";
echo "<a href=\"index.php?action=main&sid=$sid\">";
echo "Main Page</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\">";
echo "Home</a>";
echo "</p>";
echo "</p></card>";
}
--
-- Table structure for table `ibwf_urate`
--
CREATE TABLE IF NOT EXISTS `ibwf_urate` (
`id` int(100) NOT NULL AUTO_INCREMENT,
`rate` int(100) NOT NULL DEFAULT '0',
`byuid` int(100) NOT NULL DEFAULT '0',
`ratedid` int(100) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
--
-- Dumping data for table `ibwf_urate`
--
I would like to show the rating percentage and how many people rates. But cant do it. Please help. Please.
Comment