simple thanking code

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

    simple thanking code

    Code:
    ////////////////////
    else if($action=="thank")
    {
      $thank= mysql_real_escape_string( $_REQUEST["thank"] );
      
      $who = mysql_real_escape_string( $_REQUEST["who"] );
    
       addonline(getuid_sid($sid),"thanking 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 thank yourself silly <br/>";
          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\">";
    
    
        $tha = mysql_fetch_array(mysql_query("SELECT thank FROM dave_users WHERE id='".$uid."'"));
        $tha = $tha[0]+1;
        mysql_query("UPDATE dave_users SET thank='".$tha."' WHERE id='".$uid."'");
    
    
      if($res)
       {
            echo "<img src=\"../images/ok.gif\" alt=\"o\"/> thanked successfully<br/>";
       }else {
            echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You have thanked this user before<br/>";
       }
    
    
      echo "<br/><br/>";
      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>";
      }
    error i get is that it dont update it goes to you have thanked this user before without updating it .

    prob something simple but am shattered .
    Wapchat4u


    Topsites4u

    #2
    try this

    Code:
    ////////////////////
    else if($action=="thank")
    {
      $thank= mysql_real_escape_string( $_REQUEST["thank"] );
      
      $who = mysql_real_escape_string( $_REQUEST["who"] );
    
       addonline(getuid_sid($sid),"thanking 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 thank yourself silly <br/>";
          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\">";
    
    
      
    
    
    $tha = mysql_fetch_array(mysql_query("SELECT thank FROM dave_users WHERE id='".$who."'"));
         $res=mysql_query("UPDATE dave_users SET thank='".($tha[0]+1)."' WHERE id='".$who."'");
    
      if($res){
      echo "<img src=\"../images/ok.gif\" alt=\"o\"/> thanked successfully<br/>";
      }else{
      echo "<img src=\"../images/notok.gif\" alt=\"x\"/>You have thanked this user before<br/>";
      }
    
      echo "<br/><br/>";
      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>";
    }
    Last edited by crazybrumi; 24.10.09, 16:57.
    Want something coded email me at sales@webnwaphost.com for a prices.




    Comment


      #3
      lol says thanks haha .
      Wapchat4u


      Topsites4u

      Comment


        #4
        funny man lol :P..

        topic closed as fixed.
        Want something coded email me at sales@webnwaphost.com for a prices.




        Comment

        Working...
        X