CheckBox Problem

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

    CheckBox Problem

    hi guyz can u help me here..


    PHP Code:
    $view safe(cleanInput($_GET["view"]));
        
    //////ALL LISTS SCRIPT <<
        
    if($view=="")$view="all";
        if(
    $page=="" || $page<=0)$page=1;
        
    $myid getuid_sid($sid);
        
    $doit=false;
            
    $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE touid='".$uid."'"));
        
    $num_items $noi[0]; //changable
        
    $items_per_page10;
        
    $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 ibwf_users a
                INNER JOIN ibwf_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=="snt")
      {
        
    $sql "SELECT
                a.name, b.id, b.touid, b.unread, b.starred FROM ibwf_users a
                INNER JOIN ibwf_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 ibwf_users a
                INNER JOIN ibwf_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 ibwf_users a
                INNER JOIN ibwf_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
        "
    ;
      }
        
       
        
    $items mysql_query($sql);
        echo 
    mysql_error();
        while (
    $item mysql_fetch_array($items))
        {
     
    $avlink getavatar($item[2]);
          if(
    $item[3]=="1")
          {
            
    $iml "[U]";
          }else{
            if(
    $item[4]=="1")
            {
                
    $iml "[S]";
            }else{

            
    $iml "[R]";
            }
          }
          
          
    $lnk "<form action=\"inbox.php?\" method=\"post\"><input type=\"checkbox\" name=\"checkbox[]\" value=\"$item[1]\">
    <a href=\"inbox_readpm.php?pmid=
    $item[1]\">$iml$item[0]</a>";
          
          
    $pmtext mysql_fetch_array(mysql_query("SELECT text FROM ibwf_private WHERE id='".$item[1]."'"));
          
    $mprev = (htmlspecialchars(strlen($pmtext[0])<20?$pmtext[0]:substr($pmtext[0], 015)));
          
    //$mtext = parsepm($mprev, $sid);
          
    echo "$lnk$mprev..";
          echo 
    "<br/>";
        }
          echo 
    "Selected: <select name=\"checkbox\">";
     echo 
    "<option value=\"1\" select>Delete</option>";
      echo 
    "</select>";
    echo 
    "<input type=\"submit\" class=\"button\" value=\"Submit\"/>";

    echo 
    "</form>";
    foreach (
    $_POST["checkbox"] as $value)
     {
    if(
    value=="1")
              {
                
                echo 
    " Cant Delete Message,It Is Reported.";
              }else{
              
    $del mysql_query("DELETE FROM ibwf_private WHERE id={$value}");
              if(
    $del)
              {
                echo 
    "Message Deleted Successfully";
              }else{
                echo 
    "Can't Delete Message At The Moment";
              }
     

        
    }

    hi guyz how can i work this in checkbox i want to delete the check box..

    thanks for who want to help me..

    #2
    name checkbox[]
    delete the []

    Comment


      #3
      not working also.. and i want if multiple checkbox to delete..

      Comment


        #4
        wat yu want??
        pm me if i can help yu

        Comment


          #5
          Something like this

          <form action=\"./homepage.html\">
          <input type=\"CHECKBOX\" NAME=\"delete\" VALUE=\"1\">Delete!<P>
          <input type=\"SUBMIT\" VALUE=\"submit\">
          </form>

          Something like this

          <form action=\"./homepage.html\">
          <input type=\"CHECKBOX\" NAME=\"delete\" VALUE=\"1\">Delete!<P>
          <input type=\"SUBMIT\" VALUE=\"submit\">
          </form>
          Want something coded email me at sales@webnwaphost.com for a prices.




          Comment


            #6
            i already know how to manipulate that one tnt.

            use foreach loop

            thanatos@wapstreet.net

            Comment


              #7
              what kind of session does wapstreet.net has i like that, how do they hide the session id and
              how they do if you dont logout your account and visit it again its like the remember me feature, may you share me that thank you

              Comment

              Working...
              X