delete selected images with the help of checkboxes
<p>This is a page where users can edit their uploaded images.  There is a checkbox near each image.  I want to delete the selected images after user clicks the "delete selected images" button (each checkbox contains the image name as value). How can I do that?</p>

<pre><code>&lt;?php 
    session_start();
    //////////////if user already logged in go to login.php/////////
    if (isset($_SESSION['email'] )&amp;&amp; isset($_SESSION['password'] ))
    { 
    } else{header( "Location: login.php" ); }

      include('includes/config.php');


      if (isset($_POST['esubmit'])     ){

       $checkbox=$_POST['delete'];
       echo $checkbox;

       }//main one



     if (isset($_POST['esubmit'])     ){

     } else {        $clickeditid=$_GET["id"];  
         $_SESSION['eid']= $clickeditid ;
        }




 ?&gt;
 &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;Untitled Document&lt;/title&gt;
&lt;link href="css/css.css" rel="stylesheet" type="text/css" /&gt;
 &lt;style rel="stylesheet" type="text/css"&gt;
input {
  border-style: solid;
  border-color: #000000;
  border-width: 1px;
  background-color: #ffffff;
}
&lt;/style&gt;

&lt;script src="js/css_browser_selector.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;?php   


include('includes/topmenu.php');//top menu
  echo '&lt;br /&gt;';  
  include('includes/usermenu.php');///bcoz of this menu error occurs



 ////////////////////


   include('includes/edit_img_menu.php');  
 ?&gt;
  &lt;form id="form1" name="form1" method="post" action="editimg.php?id=&lt;?php echo $_SESSION['eid'];?&gt;"&gt;
  &lt;table align="center" width="70%" cellspacing="0"&gt;
  &lt;tr&gt;
    &lt;td colspan="3" align="center" bgcolor="#FFFFFF"&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td colspan="3" align="center" bgcolor="#FFFFFF"&gt;&lt;?php     
$imgcheck=mysql_query("

 SELECT *
FROM `images`
WHERE `deal_id` =$_SESSION[eid]
LIMIT 0 , 30

 ");
 $numimgcheck=mysql_num_rows($imgcheck);
 if($numimgcheck==0){echo '&lt;span style=color:#ff0000; &gt;No pictures uploaded&lt;/span&gt;';}
while ($rowimg2= mysql_fetch_array($imgcheck)){ 


  $imgname=$rowimg2['name'];

 {



     echo '    &lt;a href="users/'.$_SESSION['userid'].'/images/'.$imgname.'" rel="lightbox[slide]" caption="."&gt;';
 }


 { echo '&lt;img src="users/'.$_SESSION['userid'].'/images/thumbs/'.$imgname.'" border="0" /&gt;';}
        { echo '&lt;/a&gt;&lt;input type="checkbox" name="delete" id="delete" value="'.$imgname.'"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
';}




}
   ?&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td colspan="3" align="center" bgcolor="#FFFFFF"&gt;&amp;nbsp;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td colspan="3" align="center" bgcolor="#95F8FD"&gt;&lt;input name="esubmit" type="submit" class="red" id="esubmit" value="Delete selected images" /&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td width="89"&gt;&amp;nbsp;&lt;/td&gt;
    &lt;td colspan="2"&gt;&amp;nbsp;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
   &lt;/form&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>
