Trying To Make A User Rating System

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

    #16
    this is the query for my updating off hits
    Code:
    $update = mysql_query("UPDATE sites SET hits= hits +1 WHERE namer='$ownr'")or die(mysql_error());

    Comment


      #17
      try this

      Code:
      ////////////////////
      else if($action=="rate")
      {
        $rate= mysql_real_escape_string( $_REQUEST["rate"] );
        $bid = mysql_real_escape_string( $_REQUEST["bid"] );
        $who = mysql_real_escape_string( $_REQUEST["who"] );
      
         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
      $addplus = mysql_fetch_array(mysql_query("SELECT rate FROM wap_users WHERE id=&#39;".$who."&#39;"));
      
      // Let&#39;s add the rate + so the rate add&#39;s to the data
      // replace rate with ccreate
      
      
      $add = $rate;
      $addplus = $add + $addplus[0];
      
      // Ok.... done Lets send the query!!
      $res = mysql_query("UPDATE wap_users SET rate= &#39;".$addplus."&#39; WHERE id=&#39;".$who."&#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\"/>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>";
        
      
      }
      dave inbox me on msn or sumat and al sort it out for ya.
      Want something coded email me at sales@webnwaphost.com for a prices.




      Comment


        #18
        brumi that worked . but only works if i rate myself which is no good lol
        Wapchat4u


        Topsites4u

        Comment


          #19
          <div class='quotetop'>QUOTE (nclemale36 @ Feb 11 2009, 04:45 PM) <{POST_SNAPBACK}></div>
          brumi that worked . but only works if i rate myself which is no good lol[/b]
          try know i just changed the query from $uid to $who
          Want something coded email me at sales@webnwaphost.com for a prices.




          Comment


            #20
            na it dont do a thing now . not even update my own .
            Wapchat4u


            Topsites4u

            Comment


              #21
              <div class='quotetop'>QUOTE (nclemale36 @ Feb 11 2009, 06:02 PM) <{POST_SNAPBACK}></div>
              na it dont do a thing now . not even update my own .[/b]

              ur form needs to be edited to this
              Code:
              $who = mysql_real_escape_string( $_REQUEST["who"] );
              
              echo "<form action=\"genproc.php?action=rate&amp;sid=$sid&amp;who=$who\" 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>";
              Want something coded email me at sales@webnwaphost.com for a prices.




              Comment


                #22
                wooo hoooo at last it works lol . erm can i be cheeky and ask how i stop ppl rating them selves then
                Wapchat4u


                Topsites4u

                Comment


                  #23
                  $check = mysql_fetch_array(mysql_query("SELECT id FROM wap_users WHERE id=&#39;".$sid."&#39;"));

                  if($check[0] == "$who")
                  {
                  echo "HAHAHAHA NO NO";
                  }else{


                  just add a } at end
                  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


                    #24
                    erm try this

                    Code:
                    ////////////////////
                    else if($action=="rate")
                    {
                      $rate= mysql_real_escape_string( $_REQUEST["rate"] );
                      $bid = mysql_real_escape_string( $_REQUEST["bid"] );
                      $who = mysql_real_escape_string( $_REQUEST["who"] );
                    
                       addonline(getuid_sid($sid),"Rating a member","");
                    
                    
                    if ($uid==$who)
                    {
                          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\">";
                          echo "You Cant Rate Yourself Silly
                    ";
                          echo "</p></body></html>";
                          exit();
                    } 
                    
                      
                          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\">";
                    
                    $addplus = mysql_fetch_array(mysql_query("SELECT rate FROM wap_users WHERE id=&#39;".$who."&#39;"));
                    
                    
                    $add = $rate;
                    $addplus = $add + $addplus[0];
                    $res = mysql_query("UPDATE wap_users SET rate= &#39;".$addplus."&#39; WHERE id=&#39;".$who."&#39;");
                      if($res)
                       {
                            echo "<img src=\"../images/ok.gif\" alt=\"o\"/> rated successfully
                    ";
                       }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>";
                      }
                    Want something coded email me at sales@webnwaphost.com for a prices.




                    Comment


                      #25
                      <div class='quotetop'>QUOTE (subzero @ Feb 11 2009, 06:34 PM) <{POST_SNAPBACK}></div>
                      try this if not i dont know about lavalair[/b]

                      what did u change sub cant see out lol
                      Want something coded email me at sales@webnwaphost.com for a prices.




                      Comment


                        #26
                        no error i replaced one thing but u got it to work...
                        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


                          #27
                          Fixed including Validation For User Not To Rate Themselves.

                          Topic closed
                          Want something coded email me at sales@webnwaphost.com for a prices.




                          Comment

                          Working...
                          X