send pm to doesn't work

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

    send pm to doesn't work

    hello coderz, I have a problem in my inbox.php file. I would like to type in the recipient's nickname and not the number of the uid. This is piece of my code:
    PHP Code:

     
     
    if(isset($_POST["submit"])){
     
     if(
    valid(getuid_hits($hits)))
     {
        echo 
    "<div class=\"error\">Error this account isn't active</div>";
     }else if(
    istrashed(getuid_hits($hits)))
     {
        echo 
    " <b>You Has Been Mute!!</b>";
        }else{
      
    $whoid $_POST["whoid"];
        if(
    $whoid==0)
        {
          echo 
    "<div class=\"error\">Error this user doesn't exist</div>";
        }else{
      
    $whonick getnick_uid($whoid);
      
      
    $byuid getuid_hits($hits);
      
    $tm time();
      
    $lastpm mysql_fetch_array(mysql_query("SELECT MAX(timesent) FROM mx_private WHERE byuid='".$byuid."'"));
      
    $pmfl $lastpm[0]+27;
      if(
    $pmfl<$tm)
      {
        if(!
    isblocked($pmtext,$byuid))
        {
        if((!
    isignored($byuid$whoid))&&(!istrashed($byuid)))
        {
      
    $res mysql_query("INSERT INTO mx_private SET text='".$pmtext."', sub='".$pmsub."', byuid='".$byuid."', touid='".$whoid."', timesent='".$tm."'");
      }else{
        
    $res true;
      }
      if(
    $res)
      {
        echo 
    "<div class=\"ok\">Pm posted to $whonick . </div>";
      }else{
        echo 
    "<div class=\"error\">Error pm doesn't posted to$whonick .</div>";
      }
      }else{
        echo 
    "<div class=\"error\">Error pm doesn't posted to$whonick .</div>";
      }
      }else{
        
    $rema $pmfl $tm;
        echo 
    "<div class=\"info\">Flood control: $rema seconds</div>";
     }
     }
     }

     }

      echo 
    "<form action=\"inbox.php?show=wiaddo&amp;hits=$hits\" method=\"post\">";
      echo 
    "Nick:<br/><input name=\"whoid\" format=\"*N\" maxlength=\"5\"/><br/>";
      echo 
    "Subject:<br/><input name=\"pmsub\" maxlength=\"20\"/><br/>";
      echo 
    "text:<br/><input name=\"pmtext\" maxlength=\"500\"/><br/>";
        echo 
    "<input type=\"submit\" name=\"submit\" value=\"send\"/></form></div></div>";

        echo 
    "</body>"

    #2
    Instead
    $whoid = $_POST["whoid"];

    $whoid = isset($_POST['whoid']) ? mysql_real_escape_string($_POST['whoid']) : '';
    if ( ! is_int($whoid)) $whoid = getnick_uid($whoid);
    <?php unlink('World/Europe/Romania.country'); ?>

    Comment


      #3
      change:
      $whoid = $_POST["whoid"];
      to:
      $whoid = getuid_nick($_POST["whoid");
      and delete:
      format=\"*N\" maxlength=\"5\"
      Last edited by something else; 23.10.11, 09:20.

      Comment

      Working...
      X