Hello Guys,
I am looking for some help: I have a dynamic table that shows a checkbox, id, title,etc., and date of insertion of an article that I've added before. And then I have a button that I would like to control if the user have clicked the checkbox and which ones to foward delete those articles that he choosed. I have some ideas how to do is but I need some help.

Here's a printscreen of the table:
http://img163.imageshack.us/img163/6977/tabletr.png

Here's the code of the table:

<?php do { ?>
     <tr>
	<td><input type="checkbox" /></td>
        <td><?php echo $row_RsNoticias['sn_id']; ?></td>
        <td align="center"><a href="ver_noticia.php?vernoticia=<?php echo $row_RsNoticias['sn_id']; ?>"><?php echo $row_RsNoticias['sn_titulo']; ?></a></td>
        <td><?php echo $row_RsNoticias['sn_status']; ?></td>
	<td><?php echo date('d/m/Y H:i:s', strtotime($row_RsNoticias['sn_data'])); ?> </td>
      	</tr>
<?php } while ($row_RsNoticias = mysql_fetch_assoc($RsNoticias)); ?>

Hope someone can help me.

Best Regards,
Andre Jordao

Member Avatar

Avenirer

You should do something with the checkboxes so that, after the user pushes the "aplicar", the articles he wants to delete to be stored in an array ($_POST['deletenoticias']).

<?php do { ?>
     <tr>
    <td><input type="checkbox" name="deletenoticias[]" value="<?php echo $row_RsNoticias['sn_id'];?>" /></td>
        <td><?php echo $row_RsNoticias['sn_id']; ?></td>
        <td align="center"><a href="ver_noticia.php?vernoticia=<?php echo $row_RsNoticias['sn_id']; ?>"><?php echo $row_RsNoticias['sn_titulo']; ?></a></td>
        <td><?php echo $row_RsNoticias['sn_status']; ?></td>
    <td><?php echo date('d/m/Y H:i:s', strtotime($row_RsNoticias['sn_data'])); ?> </td>
        </tr>
<?php } while ($row_RsNoticias = mysql_fetch_assoc($RsNoticias)); ?>