Please help with rating

Started on the old forum in October 2010 · view the original in the archive · old links redirect here

#user-rating

1 reply · 367 views · started 16 years ago · 1 min read

nahid1203 Newbie · 8 posts #1

this is the rating 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>";

this is in the genproc.php

////////////////////////////////////////////////////////////////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>";

    }

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.

nahid1203 Newbie · 8 posts #2

I have done this!!! Cant believe iT!! Wow! Thanks for not helping once again. If somebody need this, i will immediately post here.

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close