CheckBox Problem

Started on the old forum in February 2011 · view the original in the archive · old links redirect here

6 replies · 493 views · started 15 years ago · 1 min read

6 participants
whitewingz Developer · 64 posts #1

hi guyz can u help me here..

$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_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 = "&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], 0, 15)));
      //$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..

tkreturns Developer · 98 posts #4

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

ASK FOR HELP

crazybrumi Super moderator Principal · 1,064 posts #5

Something like this

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

<input type="SUBMIT" VALUE="submit">

</form>

Something like this

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

<input type="SUBMIT" VALUE="submit">

</form>

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

http://flagcounter.com/more/W80q

hunter-x-hunter Junior · 29 posts #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

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close