Checkbox error in inbox

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

    Checkbox error in inbox

    every time i try to check and delete a msg it always shows 0 msg successfully deleted. i dont know where is my error here. here is my code:
    PHP Code:
    echo "<head>";
      echo "<title>My Messages</title>";
      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$test[0]\"/>";
      echo "</head>";
     echo "<meta http-equiv=\"refresh\" content=\"20; URL= inbox.php?do=$do&amp;rid=$rid\"/>";
      addonline(getuid_sid($sid),"User Inbox","");
        echo "<div align=\"center\"><div class=\"top\">Messages</div>";
        echo getshoutbox($sid);
        $res = "";
      
        if($_POST["submit"])
        {
        
        $count = 0;
        
        foreach($_POST["check"] as $value)
         {
         $pmid = $value;
         
         $pminfo = mysql_fetch_array(mysql_query("SELECT text, byuid, touid, reported FROM test_private WHERE id='".$pmid."'"));
         if ($uid==$pminfo[2])
          {
          if($pminfo[3]!=1)
           {
           $yes = mysql_query("DELETE FROM test_private WHERE id='".$pmid."'");
           if($yes)
            {
           $count++; 
            }
           }
          }     
         }
         $res = "<b>$count Messages Successfully Deleted!</b><br>";   
        }
        echo "<form action=\"inbox.php\" method=\"get\">";
        echo "View: <select name=\"view\">";
      echo "<option value=\"all\">All</option>";
      echo "<option value=\"snt\">Sent</option>";
      echo "<option value=\"str\">Starred</option>";
      echo "<option value=\"urd\">Unread</option>";
      echo "</select>";
    echo "<input type=\"hidden\" name=\"do\" value=\"$do\"/>";
    //echo "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
    echo "<input type=\"submit\" value=\"Go\"/>";
    echo "</form><br/>";
    
        echo "</div>";
        $view = safe(cleanInput($_GET["view"]));
        //////ALL LISTS SCRIPT <<
        if($view=="")$view="all";
        if($page=="" || $page<=0)$page=1;
        $myid = getuid_sid($sid);
        $doit=false;
        $num_items = getpmcount($myid,$view); //changable
        $items_per_page= 10;
        $num_pages = ceil($num_items/$items_per_page);
        if($page>$num_pages)$page= $num_pages;
        $limit_start = ($page-1)*$items_per_page;
        if($num_items>0)
        {
          if($doit)
          {
            $exp = "&amp;rwho=$myid";
          }else
          {
            $exp = "";
          }
        //changable sql
        if($view=="all")
      {
        $sql = "SELECT
                a.name, b.id, b.byuid, b.unread, b.starred FROM test_users a
                INNER JOIN test_private b ON a.id = b.byuid
                WHERE b.touid='".$myid."' AND b.folderid='0'
                ORDER BY b.timesent DESC
                LIMIT $limit_start, $items_per_page
        ";
      }
       else if($view=="fldr"){
        $sql = "SELECT
                a.name, b.id, b.byuid, b.unread, b.starred FROM test_users a
                INNER JOIN private_folders b ON a.id = b.byuid
                WHERE b.touid='".$myid."' b.folderid='".$folderid."' AND b.starred = '1'
                ORDER BY b.timesent DESC
                LIMIT $limit_start, $items_per_page
        ";
    
      }else if($view=="snt")
      {
        $sql = "SELECT
                a.name, b.id, b.touid, b.unread, b.starred FROM test_users a
                INNER JOIN test_private b ON a.id = b.touid
                WHERE b.byuid='".$myid."'
                ORDER BY b.timesent DESC
                LIMIT $limit_start, $items_per_page
        ";
      }else if($view=="str")
      {
        $sql = "SELECT
                a.name, b.id, b.byuid, b.unread, b.starred FROM test_users a
                INNER JOIN test_private b ON a.id = b.byuid
                WHERE b.touid='".$myid."' AND b.starred='1'
                ORDER BY b.timesent DESC
                LIMIT $limit_start, $items_per_page
        ";
      }else if($view=="urd")
      {
        $sql = "SELECT
                a.name, b.id, b.byuid, b.unread, b.starred FROM test_users a
                INNER JOIN test_private b ON a.id = b.byuid
                WHERE b.touid='".$myid."' AND b.unread='1'
                ORDER BY b.timesent DESC
                LIMIT $limit_start, $items_per_page
        ";
      }
        
        echo "<div class=\"nav\">Inbox</div><hr/><div align=\"left\">";
        echo $res;
        $items = mysql_query($sql);
        echo mysql_error();
        echo '<form action="inbox.php?do=main" method="post">';
        while ($item = mysql_fetch_array($items))
        {
          if($item[3]=="1")
          {
            $iml = "<small>[_]</small>";
          }else{
            if($item[4]=="1")
            {
                $iml = "<small>[str]</small>";
            }else{
    
            $iml = "<small>[x]</small>";
            }
          }
          
          $lnk = "<a href=\"pm-$item[1].php\">$iml$item[0]</a>";
          
          $pmtext = mysql_fetch_array(mysql_query("SELECT text FROM test_private WHERE id='".$item[1]."'"));
          $mprev = (htmlspecialchars(strlen($pmtext[0])<20?$pmtext[0]:substr($pmtext[0], 0, 15)));
          //$mtext = parsepm($mprev, $sid);
          echo '<input type="checkbox" name="check[]" value="'.$item[1].'"/>';
          echo "$lnk: $mprev..";
          echo "<br/>";
        }
        echo '<br><input type="submit" name="submit" value="delete"/>';
        echo '</form>';
        echo "</div>";
        echo "<div align=\"center\">";
        
          $npage = $page+1;
          echo "<hr/><a href=\"inbox.php?do=sendto\">Send Message</a><br/>";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"inbox.php?do=main&amp;page=$ppage&amp;view=$view$exp\">«Prev</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"inbox.php?do=main&amp;page=$npage&amp;view=$view$exp\">Next»</a>";
        }
        echo "<br/>$page of $num_pages<br/>";
        if($num_pages>2)
        {
          $rets = "<form action=\"inbox.php\" method=\"get\">";
          $rets .= "Go To Page: <input name=\"page\" style=\"-wap-input-format: '*N'\" size=\"2\"/>";
    $rets .= "<input type=\"submit\" value=\"Go\"/>";
            $rets .= "<input type=\"hidden\" name=\"do\" value=\"$do\"/>";
            //$rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
             
            $rets .= "<input type=\"hidden\" name=\"view\" value=\"$view\"/>";
    $rets .= "</form>";
            echo $rets;
    
          echo "<br/>";
        }
    
    echo "<form action=\"inbxproc.php?do=proall\" method=\"post\">";
          echo "Delete: <select name=\"pmact\">";
      echo "<option value=\"red\">Read</option>";
      echo "<option value=\"unrd\">Unread</option>";
      echo "<option value=\"ust\">Unstarred</option>";
      echo "<option value=\"all\">All Msg</option>";
      echo "</select>";
    echo "<input type=\"submit\" value=\"Go\"/>";
    echo "</form></div>";
    echo "<div align=\"center\"><a href=\"inbox.php?do=crfolder\">Create New Folder</a><br/>";
         echo "<a href=\"inbox.php?do=myfolder\">My Folders</a><br/>";
    
        }else{
          echo "<div align=\"center\">";
          echo "You Have No Private Messages<br/><a href=\"inbox.php?do=sendto\">Send Message</a><br/>";
          echo "<div align=\"center\"><a href=\"inbox.php?do=crfolder\">Create New Folder</a><br/>";
          echo "<a href=\"inbox.php?do=myfolder\">My Folders</a><br/>";
          echo "</div>";
        }
      ////// UNTILL HERE >>
    
        
        
      echo "<div align=\"center\">";
    
    $plc = mysql_fetch_array(mysql_query("SELECT saan FROM test_users WHERE id='".$uid."'"));
    echo "<br/><a href=\"$plc[0]\">Exit Inbox</a> ";
      echo "<a href=\"index.php?do=forums\">Forums</a> <a href=\"index.php?do=chat\">Chatrooms</a> <a href=\"main.php\">";
    echo "Home</a><hr/><div class=\"footer\">$mysite</div>";
      echo "<br/>Script Timer ";
    $load = microtime();
    print (number_format($load,2));
    echo " sec";
    
     echo "</div>";
      echo "</body>";
      } 
    
    Last edited by metulj; 23.04.12, 09:06. Reason: use [ php ] tag [ / php ] for posting code

    #2
    use [ php ] [ /php ] tags
    or [ code ] [ /code ] tags
    PHP Code:
    $check = $_POST["check"];
    foreach($check as $value) 
    
    Last edited by something else; 23.04.12, 09:17.

    Comment


      #3
      is it n0t d same with d one i did?d only difference iv n0ticed is d variable u put?tnx anyway
      Last edited by ACIDCORE; 23.04.12, 12:07.

      Comment


        #4
        $uid is not defined

        Comment


          #5
          Originally posted by something else View Post
          $uid is not defined
          PHP Code:
          $uid = getuid_sid($sid); 
          
          but i still can't delete selected pms..any other idea?

          Comment


            #6
            try:
            PHP Code:
            echo "<input type=\"submit\" name=\"submit\" value=\"Go\"/>";
            //random text here to get rid of opera bug :/ 
            

            Comment


              #7
              im still getting the same erro.any other idea mate?it would be a nice share if u do so.tnx

              Comment


                #8
                delete $_Post trim($_Post) from core.php and those foreach ($_Post) in core.php and iconect.php this code will work..

                Comment


                  #9
                  lol

                  its because u set the $count variable to 0 then when u call it your getting the 0 that u set


                  PHP Code:
                  <?
                  echo "<head>"; 
                    echo "<title>My Messages</title>"; 
                    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$test[0]\"/>"; 
                    echo "</head>"; 
                   echo "<meta http-equiv=\"refresh\" content=\"20; URL= inbox.php?do=$do&amp;rid=$rid\"/>"; 
                    addonline(getuid_sid($sid),"User Inbox",""); 
                      echo "<div align=\"center\"><div class=\"top\">Messages</div>"; 
                      echo getshoutbox($sid); 
                      $res = ""; 
                     
                      if($_POST["submit"]) 
                      { 
                       
                     $count = 0; //<-------------------------------------------------------------------------------------------------------------problem is here
                       
                      foreach($_POST["check"] as $value) 
                       { 
                       $pmid = $value; 
                        
                       $pminfo = mysql_fetch_array(mysql_query("SELECT text, byuid, touid, reported FROM test_private WHERE id='".$pmid."'")); 
                       if ($uid==$pminfo[2]) 
                        { 
                        if($pminfo[3]!=1) 
                         { 
                         $yes = mysql_query("DELETE FROM test_private WHERE id='".$pmid."'"); 
                         if($yes) 
                          { 
                         $count++;  
                          } 
                         } 
                        }      
                       } 
                       $res = "<b>$count Messages Successfully Deleted!</b><br>";    
                      } 
                      echo "<form action=\"inbox.php\" method=\"get\">"; 
                      echo "View: <select name=\"view\">"; 
                    echo "<option value=\"all\">All</option>"; 
                    echo "<option value=\"snt\">Sent</option>"; 
                    echo "<option value=\"str\">Starred</option>"; 
                    echo "<option value=\"urd\">Unread</option>"; 
                    echo "</select>"; 
                  echo "<input type=\"hidden\" name=\"do\" value=\"$do\"/>"; 
                  //echo "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>"; 
                  echo "<input type=\"submit\" value=\"Go\"/>"; 
                  echo "</form><br/>"; 
                  
                      echo "</div>"; 
                      $view = safe(cleanInput($_GET["view"])); 
                      //////ALL LISTS SCRIPT << 
                      if($view=="")$view="all"; 
                      if($page=="" || $page<=0)$page=1; 
                      $myid = getuid_sid($sid); 
                      $doit=false; 
                      $num_items = getpmcount($myid,$view); //changable 
                      $items_per_page= 10; 
                      $num_pages = ceil($num_items/$items_per_page); 
                      if($page>$num_pages)$page= $num_pages; 
                      $limit_start = ($page-1)*$items_per_page; 
                      if($num_items>0) 
                      { 
                        if($doit) 
                        { 
                          $exp = "&amp;rwho=$myid"; 
                        }else 
                        { 
                          $exp = ""; 
                        } 
                      //changable sql 
                      if($view=="all") 
                    { 
                      $sql = "SELECT 
                              a.name, b.id, b.byuid, b.unread, b.starred FROM test_users a 
                              INNER JOIN test_private b ON a.id = b.byuid 
                              WHERE b.touid='".$myid."' AND b.folderid='0' 
                              ORDER BY b.timesent DESC 
                              LIMIT $limit_start, $items_per_page 
                      "; 
                    } 
                     else if($view=="fldr"){ 
                      $sql = "SELECT 
                              a.name, b.id, b.byuid, b.unread, b.starred FROM test_users a 
                              INNER JOIN private_folders b ON a.id = b.byuid 
                              WHERE b.touid='".$myid."' b.folderid='".$folderid."' AND b.starred = '1' 
                              ORDER BY b.timesent DESC 
                              LIMIT $limit_start, $items_per_page 
                      "; 
                  
                    }else if($view=="snt") 
                    { 
                      $sql = "SELECT 
                              a.name, b.id, b.touid, b.unread, b.starred FROM test_users a 
                              INNER JOIN test_private b ON a.id = b.touid 
                              WHERE b.byuid='".$myid."' 
                              ORDER BY b.timesent DESC 
                              LIMIT $limit_start, $items_per_page 
                      "; 
                    }else if($view=="str") 
                    { 
                      $sql = "SELECT 
                              a.name, b.id, b.byuid, b.unread, b.starred FROM test_users a 
                              INNER JOIN test_private b ON a.id = b.byuid 
                              WHERE b.touid='".$myid."' AND b.starred='1' 
                              ORDER BY b.timesent DESC 
                              LIMIT $limit_start, $items_per_page 
                      "; 
                    }else if($view=="urd") 
                    { 
                      $sql = "SELECT 
                              a.name, b.id, b.byuid, b.unread, b.starred FROM test_users a 
                              INNER JOIN test_private b ON a.id = b.byuid 
                              WHERE b.touid='".$myid."' AND b.unread='1' 
                              ORDER BY b.timesent DESC 
                              LIMIT $limit_start, $items_per_page 
                      "; 
                    } 
                       
                      echo "<div class=\"nav\">Inbox</div><hr/><div align=\"left\">"; 
                      echo $res; 
                      $items = mysql_query($sql); 
                      echo mysql_error(); 
                      echo '<form action="inbox.php?do=main" method="post">'; 
                      while ($item = mysql_fetch_array($items)) 
                      { 
                        if($item[3]=="1") 
                        { 
                          $iml = "<small>[_]</small>"; 
                        }else{ 
                          if($item[4]=="1") 
                          { 
                              $iml = "<small>[str]</small>"; 
                          }else{ 
                  
                          $iml = "<small>[x]</small>"; 
                          } 
                        } 
                         
                        $lnk = "<a href=\"pm-$item[1].php\">$iml$item[0]</a>"; 
                         
                        $pmtext = mysql_fetch_array(mysql_query("SELECT text FROM test_private WHERE id='".$item[1]."'")); 
                        $mprev = (htmlspecialchars(strlen($pmtext[0])<20?$pmtext[0]:substr($pmtext[0], 0, 15))); 
                        //$mtext = parsepm($mprev, $sid); 
                        echo '<input type="checkbox" name="check[]" value="'.$item[1].'"/>'; 
                        echo "$lnk: $mprev.."; 
                        echo "<br/>"; 
                      } 
                      echo '<br><input type="submit" name="submit" value="delete"/>'; 
                      echo '</form>'; 
                      echo "</div>"; 
                      echo "<div align=\"center\">"; 
                       
                        $npage = $page+1; 
                        echo "<hr/><a href=\"inbox.php?do=sendto\">Send Message</a><br/>"; 
                      if($page>1) 
                      { 
                        $ppage = $page-1; 
                        echo "<a href=\"inbox.php?do=main&amp;page=$ppage&amp;view=$view$exp\">«Prev</a> "; 
                      } 
                      if($page<$num_pages) 
                      { 
                        $npage = $page+1; 
                        echo "<a href=\"inbox.php?do=main&amp;page=$npage&amp;view=$view$exp\">Next»</a>"; 
                      } 
                      echo "<br/>$page of $num_pages<br/>"; 
                      if($num_pages>2) 
                      { 
                        $rets = "<form action=\"inbox.php\" method=\"get\">"; 
                        $rets .= "Go To Page: <input name=\"page\" style=\"-wap-input-format: '*N'\" size=\"2\"/>"; 
                  $rets .= "<input type=\"submit\" value=\"Go\"/>"; 
                          $rets .= "<input type=\"hidden\" name=\"do\" value=\"$do\"/>"; 
                          //$rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>"; 
                            
                          $rets .= "<input type=\"hidden\" name=\"view\" value=\"$view\"/>"; 
                  $rets .= "</form>"; 
                          echo $rets; 
                  
                        echo "<br/>"; 
                      } 
                  
                  echo "<form action=\"inbxproc.php?do=proall\" method=\"post\">"; 
                        echo "Delete: <select name=\"pmact\">"; 
                    echo "<option value=\"red\">Read</option>"; 
                    echo "<option value=\"unrd\">Unread</option>"; 
                    echo "<option value=\"ust\">Unstarred</option>"; 
                    echo "<option value=\"all\">All Msg</option>"; 
                    echo "</select>"; 
                  echo "<input type=\"submit\" value=\"Go\"/>"; 
                  echo "</form></div>"; 
                  echo "<div align=\"center\"><a href=\"inbox.php?do=crfolder\">Create New Folder</a><br/>"; 
                       echo "<a href=\"inbox.php?do=myfolder\">My Folders</a><br/>"; 
                  
                      }else{ 
                        echo "<div align=\"center\">"; 
                        echo "You Have No Private Messages<br/><a href=\"inbox.php?do=sendto\">Send Message</a><br/>"; 
                        echo "<div align=\"center\"><a href=\"inbox.php?do=crfolder\">Create New Folder</a><br/>"; 
                        echo "<a href=\"inbox.php?do=myfolder\">My Folders</a><br/>"; 
                        echo "</div>"; 
                      } 
                    ////// UNTILL HERE >> 
                  
                       
                       
                    echo "<div align=\"center\">"; 
                  
                  $plc = mysql_fetch_array(mysql_query("SELECT saan FROM test_users WHERE id='".$uid."'")); 
                  echo "<br/><a href=\"$plc[0]\">Exit Inbox</a> "; 
                    echo "<a href=\"index.php?do=forums\">Forums</a> <a href=\"index.php?do=chat\">Chatrooms</a> <a href=\"main.php\">"; 
                  echo "Home</a><hr/><div class=\"footer\">$mysite</div>"; 
                    echo "<br/>Script Timer "; 
                  $load = microtime(); 
                  print (number_format($load,2)); 
                  echo " sec"; 
                  
                   echo "</div>"; 
                    echo "</body>"; 
                    }
                  Creator of
                  Epix.Mobi

                  Keep an Eye on us Big things coming soon!!!!
                  Need something for your site hit me up here

                  http://coding-talk.com/forum/main-fo...r-your-wapsite

                  Comment


                    #10
                    Originally posted by ACIDCORE View Post
                    every time i try to check and delete a msg it always shows 0 msg successfully deleted. i dont know where is my error here. here is my code:
                    PHP Code:
                    echo "<head>";
                      echo "<title>My Messages</title>";
                      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$test[0]\"/>";
                      echo "</head>";
                     echo "<meta http-equiv=\"refresh\" content=\"20; URL= inbox.php?do=$do&amp;rid=$rid\"/>";
                      addonline(getuid_sid($sid),"User Inbox","");
                        echo "<div align=\"center\"><div class=\"top\">Messages</div>";
                        echo getshoutbox($sid);
                        $res = "";
                      
                        if($_POST["submit"])
                        {
                        
                        $count = 0;
                        
                        foreach($_POST["check"] as $value)
                         {
                         $pmid = $value;
                         
                         $pminfo = mysql_fetch_array(mysql_query("SELECT text, byuid, touid, reported FROM test_private WHERE id='".$pmid."'"));
                         if ($uid==$pminfo[2])
                          {
                          if($pminfo[3]!=1)
                           {
                           $yes = mysql_query("DELETE FROM test_private WHERE id='".$pmid."'");
                           if($yes)
                            {
                           $count++; 
                            }
                           }
                          }     
                         }
                         $res = "<b>$count Messages Successfully Deleted!</b><br>";   
                        }
                        echo "<form action=\"inbox.php\" method=\"get\">";
                        echo "View: <select name=\"view\">";
                      echo "<option value=\"all\">All</option>";
                      echo "<option value=\"snt\">Sent</option>";
                      echo "<option value=\"str\">Starred</option>";
                      echo "<option value=\"urd\">Unread</option>";
                      echo "</select>";
                    echo "<input type=\"hidden\" name=\"do\" value=\"$do\"/>";
                    //echo "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
                    echo "<input type=\"submit\" value=\"Go\"/>";
                    echo "</form><br/>";
                    
                        echo "</div>";
                        $view = safe(cleanInput($_GET["view"]));
                        //////ALL LISTS SCRIPT <<
                        if($view=="")$view="all";
                        if($page=="" || $page<=0)$page=1;
                        $myid = getuid_sid($sid);
                        $doit=false;
                        $num_items = getpmcount($myid,$view); //changable
                        $items_per_page= 10;
                        $num_pages = ceil($num_items/$items_per_page);
                        if($page>$num_pages)$page= $num_pages;
                        $limit_start = ($page-1)*$items_per_page;
                        if($num_items>0)
                        {
                          if($doit)
                          {
                            $exp = "&amp;rwho=$myid";
                          }else
                          {
                            $exp = "";
                          }
                        //changable sql
                        if($view=="all")
                      {
                        $sql = "SELECT
                                a.name, b.id, b.byuid, b.unread, b.starred FROM test_users a
                                INNER JOIN test_private b ON a.id = b.byuid
                                WHERE b.touid='".$myid."' AND b.folderid='0'
                                ORDER BY b.timesent DESC
                                LIMIT $limit_start, $items_per_page
                        ";
                      }
                       else if($view=="fldr"){
                        $sql = "SELECT
                                a.name, b.id, b.byuid, b.unread, b.starred FROM test_users a
                                INNER JOIN private_folders b ON a.id = b.byuid
                                WHERE b.touid='".$myid."' b.folderid='".$folderid."' AND b.starred = '1'
                                ORDER BY b.timesent DESC
                                LIMIT $limit_start, $items_per_page
                        ";
                    
                      }else if($view=="snt")
                      {
                        $sql = "SELECT
                                a.name, b.id, b.touid, b.unread, b.starred FROM test_users a
                                INNER JOIN test_private b ON a.id = b.touid
                                WHERE b.byuid='".$myid."'
                                ORDER BY b.timesent DESC
                                LIMIT $limit_start, $items_per_page
                        ";
                      }else if($view=="str")
                      {
                        $sql = "SELECT
                                a.name, b.id, b.byuid, b.unread, b.starred FROM test_users a
                                INNER JOIN test_private b ON a.id = b.byuid
                                WHERE b.touid='".$myid."' AND b.starred='1'
                                ORDER BY b.timesent DESC
                                LIMIT $limit_start, $items_per_page
                        ";
                      }else if($view=="urd")
                      {
                        $sql = "SELECT
                                a.name, b.id, b.byuid, b.unread, b.starred FROM test_users a
                                INNER JOIN test_private b ON a.id = b.byuid
                                WHERE b.touid='".$myid."' AND b.unread='1'
                                ORDER BY b.timesent DESC
                                LIMIT $limit_start, $items_per_page
                        ";
                      }
                        
                        echo "<div class=\"nav\">Inbox</div><hr/><div align=\"left\">";
                        echo $res;
                        $items = mysql_query($sql);
                        echo mysql_error();
                        echo '<form action="inbox.php?do=main" method="post">';
                        while ($item = mysql_fetch_array($items))
                        {
                          if($item[3]=="1")
                          {
                            $iml = "<small>[_]</small>";
                          }else{
                            if($item[4]=="1")
                            {
                                $iml = "<small>[str]</small>";
                            }else{
                    
                            $iml = "<small>[x]</small>";
                            }
                          }
                          
                          $lnk = "<a href=\"pm-$item[1].php\">$iml$item[0]</a>";
                          
                          $pmtext = mysql_fetch_array(mysql_query("SELECT text FROM test_private WHERE id='".$item[1]."'"));
                          $mprev = (htmlspecialchars(strlen($pmtext[0])<20?$pmtext[0]:substr($pmtext[0], 0, 15)));
                          //$mtext = parsepm($mprev, $sid);
                          echo '<input type="checkbox" name="check[]" value="'.$item[1].'"/>';
                          echo "$lnk: $mprev..";
                          echo "<br/>";
                        }
                        echo '<br><input type="submit" name="submit" value="delete"/>';
                        echo '</form>';
                        echo "</div>";
                        echo "<div align=\"center\">";
                        
                          $npage = $page+1;
                          echo "<hr/><a href=\"inbox.php?do=sendto\">Send Message</a><br/>";
                        if($page>1)
                        {
                          $ppage = $page-1;
                          echo "<a href=\"inbox.php?do=main&amp;page=$ppage&amp;view=$view$exp\">«Prev</a> ";
                        }
                        if($page<$num_pages)
                        {
                          $npage = $page+1;
                          echo "<a href=\"inbox.php?do=main&amp;page=$npage&amp;view=$view$exp\">Next»</a>";
                        }
                        echo "<br/>$page of $num_pages<br/>";
                        if($num_pages>2)
                        {
                          $rets = "<form action=\"inbox.php\" method=\"get\">";
                          $rets .= "Go To Page: <input name=\"page\" style=\"-wap-input-format: '*N'\" size=\"2\"/>";
                    $rets .= "<input type=\"submit\" value=\"Go\"/>";
                            $rets .= "<input type=\"hidden\" name=\"do\" value=\"$do\"/>";
                            //$rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
                             
                            $rets .= "<input type=\"hidden\" name=\"view\" value=\"$view\"/>";
                    $rets .= "</form>";
                            echo $rets;
                    
                          echo "<br/>";
                        }
                    
                    echo "<form action=\"inbxproc.php?do=proall\" method=\"post\">";
                          echo "Delete: <select name=\"pmact\">";
                      echo "<option value=\"red\">Read</option>";
                      echo "<option value=\"unrd\">Unread</option>";
                      echo "<option value=\"ust\">Unstarred</option>";
                      echo "<option value=\"all\">All Msg</option>";
                      echo "</select>";
                    echo "<input type=\"submit\" value=\"Go\"/>";
                    echo "</form></div>";
                    echo "<div align=\"center\"><a href=\"inbox.php?do=crfolder\">Create New Folder</a><br/>";
                         echo "<a href=\"inbox.php?do=myfolder\">My Folders</a><br/>";
                    
                        }else{
                          echo "<div align=\"center\">";
                          echo "You Have No Private Messages<br/><a href=\"inbox.php?do=sendto\">Send Message</a><br/>";
                          echo "<div align=\"center\"><a href=\"inbox.php?do=crfolder\">Create New Folder</a><br/>";
                          echo "<a href=\"inbox.php?do=myfolder\">My Folders</a><br/>";
                          echo "</div>";
                        }
                      ////// UNTILL HERE >>
                    
                        
                        
                      echo "<div align=\"center\">";
                    
                    $plc = mysql_fetch_array(mysql_query("SELECT saan FROM test_users WHERE id='".$uid."'"));
                    echo "<br/><a href=\"$plc[0]\">Exit Inbox</a> ";
                      echo "<a href=\"index.php?do=forums\">Forums</a> <a href=\"index.php?do=chat\">Chatrooms</a> <a href=\"main.php\">";
                    echo "Home</a><hr/><div class=\"footer\">$mysite</div>";
                      echo "<br/>Script Timer ";
                    $load = microtime();
                    print (number_format($load,2));
                    echo " sec";
                    
                     echo "</div>";
                      echo "</body>";
                      } 
                    
                    That basicly goes like this, you manage what you want and maybe you may let sql query to select. Just an example.

                    PHP Code:
                    
                    $delete = mysql_query('SELECT `id` FROM `test_private` WHERE `reported` != \'1\' AND `touid` != \'1\' AND `id` = '.$pmid.'');
                    $count = 0;
                    while ($del = mysql_fetch_array($delete)) {
                        @mysql_query('DELETE FROM `test_private` WHERE `id` = '.$del[0].'');
                    $count++;
                    } 
                    
                    Last edited by arnage; 05.05.12, 15:05.
                    <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

                    Comment


                      #11
                      tnx mate..i alm0st f0rgot,i hv c0nflict functi0n of it in my c0re..just lyk d other tyms.i ws so careless.i'll just use javascript 4 d checkb0x 2 avoid that..

                      Comment


                        #12
                        I don't understand, javascript has nothing to do with this. But doesn't matter, either for me in the future when i see lava or the like. ;)
                        <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

                        Comment

                        Working...
                        X