Trying To Make A User Rating System

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Trying To Make A User Rating System

    i have got so far . i have tried loads of variations of codes etc. cant get it to update correctly with the amount you click on . plus its only updating my own profile by 1 everytime i choose something. even if its a 9 it only goes up by 1.

    it dont update other users at all .so as u see i need help lol . i done the hard work then get stuck.
    can anyone help . ta

    this is in profile
    Code:
    echo "<form action=\"genproc.php?action=rate&amp;sid=$sid\" method=\"post\"><p align=\"center\">";
      echo "<select name=\"rate\">";
      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>";
      echo "<input type=\"Submit\" Name=\"Rate\" Value=\"Rate\"></form>";
    
    $nopl = mysql_fetch_array(mysql_query("SELECT rate FROM wap_users WHERE id=&#39;".$who."&#39;"));
    
      echo "[b]Rating:[/b] $nopl[0]
    ";
    this is genproc to update it
    Code:
    ////////////////////
    else if($action=="rate")
    {
      $rate = $_POST["rate"];
      $bid = $_GET["bid"];
      addonline(getuid_sid($sid),"Rating a member","");
      //$uid = getuid_sid($sid);
      
          echo "<head>";
          echo "<title>$sitename</title>";
          echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
          echo "</head>";
          echo "<body>";
      echo "<p align=\"center\">";
      $res = mysql_query("UPDATE wap_users SET rate=&#39;".$rate."&#39; WHERE id=&#39;".$uid."&#39;");
      if($res)
       {
            echo "<img src=\"../images/ok.gif\" alt=\"o\"/> rated successfully
    ";
       }else{
            echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!
    ";
      }
    }else{
        echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You have rated this user before
    ";
     
      echo "
    
    ";
        echo "[b]0 [/b]<a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo "</p></body>";
      
    
    }
    put me out my misery pmpl .
    Wapchat4u


    Topsites4u

    #2
    an update . worked out its not adding the ratings together . all its its doing is if i choose rate 4 it updates the database to 4. and if i again choose rate 2 it updates it to 2 . instead of adding the 4 and 2 together. am lost .anyone ??
    Wapchat4u


    Topsites4u

    Comment


      #3
      Code:
      // Let&#39;s see how many is there count it up
      $rate = mysql_fetch_array(mysql_query("SELECT COUNT(*) rate FROM wap_users  WHERE id=&#39;".$uid."&#39; "));
      // Let&#39;s add the rate + so the rate add&#39;s to the data
      $id = $rate[0]+$rate;
      // Ok.... done Lets send the query!!
      $res = mysql_query("UPDATE wap_users SET rate=&#39;$id&#39; WHERE id=&#39;".$uid."&#39;");
      // query has being sent to mysql Job done!
      Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
      Visit: WapMasterz Coming Back Soon!
      _______
      SCRIPTS FOR SALE BY SUBZERO
      Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
      FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
      _______
      Info & Tips
      php.net
      w3schools.com

      Comment


        #4
        cheers sub.

        ppl can learn if things are described like that .

        Wapchat4u


        Topsites4u

        Comment


          #5
          hate to say this but wer do i put the

          Code:
          $id = $rate[0]+$rate;
          cos am getting an error i have never seen before

          put it in index next to the form code and got error .

          does this go in the update code in genproc if so wer abouts . ?? thank you so muchly lol
          Wapchat4u


          Topsites4u

          Comment


            #6

            I made misstake with id with id this will work

            Code:
            // Let&#39;s see how many is there count it up
            $rate = mysql_fetch_array(mysql_query("SELECT COUNT(*) rate FROM wap_users  WHERE id=&#39;".$uid."&#39; "));
            // Let&#39;s add the rate + so the rate add&#39;s to the data
            $go = $rate[0]+$rate;
            // Ok.... done Lets send the query!!
            $res = mysql_query("UPDATE wap_users SET rate=&#39;$go&#39; WHERE id=&#39;".$uid."&#39;");
            // query has being sent to mysql Job done!
            Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
            Visit: WapMasterz Coming Back Soon!
            _______
            SCRIPTS FOR SALE BY SUBZERO
            Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
            FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
            _______
            Info & Tips
            php.net
            w3schools.com

            Comment


              #7
              but wer do i put it sub ?? cos am still getting the same error
              Wapchat4u


              Topsites4u

              Comment


                #8
                Code:
                ////////////////////
                else if($action=="rate")
                {
                  $rate = $_POST["rate"];
                  $bid = $_GET["bid"];
                  addonline(getuid_sid($sid),"Rating a member","");
                  //$uid = getuid_sid($sid);
                  
                      echo "<head>";
                      echo "<title>$sitename</title>";
                      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
                      echo "</head>";
                      echo "<body>";
                  echo "<p align=\"center\">";
                  // Let&#39;s see how many is there count it up
                $rate = mysql_fetch_array(mysql_query("SELECT COUNT(*) rate FROM wap_users  WHERE id=&#39;".$uid."&#39; "));
                // Let&#39;s add the rate + so the rate add&#39;s to the data
                $go = $rate[0]+$rate;
                // Ok.... done Lets send the query!!
                $res = mysql_query("UPDATE wap_users SET rate=&#39;$go&#39; WHERE id=&#39;".$uid."&#39;");
                // query has being sent to mysql Job done!
                  if($res)
                   {
                        echo "<img src=\"../images/ok.gif\" alt=\"o\"/> rated successfully
                ";
                   }else{
                        echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!
                ";
                  }
                }else{
                    echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You have rated this user before
                ";
                
                  echo "
                
                ";
                    echo "[b]0 [/b]<a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
                  echo "</p></body>";
                  
                
                }
                Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
                Visit: WapMasterz Coming Back Soon!
                _______
                SCRIPTS FOR SALE BY SUBZERO
                Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
                FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
                _______
                Info & Tips
                php.net
                w3schools.com

                Comment


                  #9
                  id was mixing with id

                  so i change id to go
                  Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
                  Visit: WapMasterz Coming Back Soon!
                  _______
                  SCRIPTS FOR SALE BY SUBZERO
                  Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
                  FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
                  _______
                  Info & Tips
                  php.net
                  w3schools.com

                  Comment


                    #10
                    thanks for your help sub . .
                    Wapchat4u


                    Topsites4u

                    Comment


                      #11
                      Fatal error: Unsupported operand types in /home/wap/public_html/web/genproc.php on line 2166

                      thats the same error i got when i put that one line in index too.

                      Wapchat4u


                      Topsites4u

                      Comment


                        #12
                        Hmmm


                        found rate change to $ccrate

                        add $ccrate = "$rate";

                        replace $rate with $ccrate


                        --------------------

                        rukiya Do You Mind kid read the dam forum will you any more smart mouth liar who cant fukin read wasting time kid!

                        This will be your warning!
                        Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
                        Visit: WapMasterz Coming Back Soon!
                        _______
                        SCRIPTS FOR SALE BY SUBZERO
                        Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
                        FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
                        _______
                        Info & Tips
                        php.net
                        w3schools.com

                        Comment


                          #13
                          Lets see it will count for you


                          Code:
                          <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
                          <head><link rel="stylesheet" type="text/css" href="../css/style.css"></link><title>PHP INFO</title>
                          </head><body>
                          
                          <?php
                          
                          if($act=="")
                          {
                          
                          echo "<form action=\"?act=rate\" method=\"post\"><p align=\"center\">";
                            echo "<select name=\"set\">";
                            echo "<option value=\"1\">1</option>";
                            echo "<option value=\"20\">20</option>";
                            echo "<option value=\"30\">30</option>";
                            echo "<option value=\"40\">40</option>";
                            echo "<option value=\"50\">50</option>";
                            echo "<option value=\"60\">60</option>";
                            echo "<option value=\"70\">70</option>";
                            echo "<option value=\"80\">80</option>";
                            echo "<option value=\"90\">90</option>";
                            echo "<option value=\"1008\">1008</option>";
                            echo "</select>";
                          
                          echo "<input type=\"submit\" value=\"SUBMIT\"/></form>";
                          }
                          else if($act=="rate")
                          {
                          
                          $idc = "100";
                          $id = $idc+$set;
                          
                          echo "$id";
                          }
                          ?>
                          </body>
                          </html>
                          Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
                          Visit: WapMasterz Coming Back Soon!
                          _______
                          SCRIPTS FOR SALE BY SUBZERO
                          Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
                          FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
                          _______
                          Info & Tips
                          php.net
                          w3schools.com

                          Comment


                            #14
                            Hey try this http://sof.us.to/sig/setup/show.php

                            i made a CALCULATOR

                            Code:
                            <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
                            <head><link rel="stylesheet" type="text/css" href="../css/style.css"></link><title>PHP INFO</title>
                            </head><body>
                            
                            <?php
                            
                            if($act=="")
                            {
                            
                            echo "<form action=\"?act=rate\" method=\"post\">";
                            echo "<input type =\"text\" class=\"bginput\" name=\"ad1\"/>
                            ";
                              echo "<select name=\"sa\">";
                              echo "<option value=\"-\">-</option>";
                              echo "<option value=\"+\">+</option>";
                              echo "<option value=\"%\">%</option>";
                             
                              echo "</select>
                            ";
                            echo "<input type =\"text\" class=\"bginput\" name=\"ad2\"/>
                            ";
                            echo "<input type=\"submit\" value=\"SUBMIT\"/></form>";
                            }
                            else if($act=="rate")
                            {
                            if($sa =="+")
                            {
                            $id = $ad1 +  $ad2;
                            }
                            if($sa =="-")
                            {
                            $id = $ad1-$ad2;
                            }
                            if($sa =="%")
                            {
                            $id = $ad1%$ad2;
                            }
                            
                            
                            echo "$ad1 $sa $ad2 = $id";
                            }
                            ?>
                            </body>
                            </html>
                            you can see what i did to make the CALCULATOR
                            Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
                            Visit: WapMasterz Coming Back Soon!
                            _______
                            SCRIPTS FOR SALE BY SUBZERO
                            Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
                            FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
                            _______
                            Info & Tips
                            php.net
                            w3schools.com

                            Comment


                              #15
                              Code:
                              ////////////////////
                              else if($action=="rate")
                              {
                                $rate = $_POST["rate"];
                                $bid = $_GET["bid"];
                                addonline(getuid_sid($sid),"Rating a member","");
                                //$uid = getuid_sid($sid);
                                
                                    echo "<head>";
                                    echo "<title>$sitename</title>";
                                    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
                                    echo "</head>";
                                    echo "<body>";
                                echo "<p align=\"center\">";
                                // Let&#39;s see how many is there count it up
                              $rate = mysql_fetch_array(mysql_query("SELECT COUNT(*) rate FROM wap_users  WHERE id=&#39;".$uid."&#39; "));
                              
                              // Let&#39;s add the rate + so the rate add&#39;s to the data
                              // replace rate with ccreate
                              $ccrate ="$rate";
                              $go = $rate[0]+$ccrate;
                              // Ok.... done Lets send the query!!
                              $res = mysql_query("UPDATE wap_users SET rate=&#39;$go&#39; WHERE id=&#39;".$uid."&#39;");
                              // query has being sent to mysql Job done!
                                if($res)
                                 {
                                      echo "<img src=\"../images/ok.gif\" alt=\"o\"/> rated successfully
                              ";
                                 }else{
                                      echo "<img src=\"../images/notok.gif\" alt=\"x\"/>Database Error!
                              ";
                                }
                              }else{
                                  echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You have rated this user before
                              ";
                              
                                echo "
                              
                              ";
                                  echo "[b]0 [/b]<a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
                                echo "</p></body>";
                                
                              
                              }

                              Try this bro i leave the [0] in rate
                              Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
                              Visit: WapMasterz Coming Back Soon!
                              _______
                              SCRIPTS FOR SALE BY SUBZERO
                              Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
                              FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
                              _______
                              Info & Tips
                              php.net
                              w3schools.com

                              Comment

                              Working...
                              X