Good morning guys, I need help :( It is as follows, I need to delete several records at once so I need to select the ID of each record, so I did an input with a checkbox inside the loop like this:
<form method="POST" id="formDeletarMsg" action="deletarMsg.php">
<input type="checkbox" name="msg[]" value="<?php echo $idMsg; ?>">
</form>
The submit button is out of the form, I'm using javascript because it will stay in the section footer.
And I'm using a foreach to display the data of each checkbox, it even works, only it only displays the first checked checkbox, if I mark the second or third it does not display anything, if I mark the first one it displays:
if(isset($_POST['msg'])){
$msg = $_POST['msg'];
foreach($msg as $key => $value){
echo $key . "<br>";
echo $value;
}
var_dump($value);
}