Please help with rating

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Please help with rating

    this is the rating code
    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&amp;sid=$sid&amp;who=$who\" method=\"post\">";
      echo 
    "<postfield name=\"rate\" value=\"$(rate)\"/>";
      echo 
    "</go></anchor>"
    this is in the genproc.php
    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&amp;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&amp;sid=$sid\">";
    echo 
    "Main Page</a><br/>";
            
        echo 
    "<a href=\"index.php?action=main&amp;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.
    Last edited by nahid1203; 04.10.10, 07:26.

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

    Comment

    Working...
    X