I have below php table, it has row and column. Each row has checkbox, I am trying to retrieve email data from row that checkbox is selected. I can do this with Jquery, but since I can't save in text file. I am trying to do same thing with PHP. I try couple things, but none worked.
<?php
echo "<table border='1' bordercolor='red' id='event_table'>
<tr>
<th> <input type='checkbox' id='chk_all' /> </th>
<th>Id</td>
<th>Email</th>
<th>Name</th>
<th>Car</th>
<th>Phone</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td> <input type='checkbox' id='chk[]'/> </td>";
echo "<td>" . $row['id'] . "</td>";
echo "<td>" . $row['email'] . "</td>";
echo "<td>" . $row['name'] . "</td>";
echo "<td>" . $row['car'] . "</td>";
echo "<td>" . $row['phone'] , "</td>";
echo "</tr>";
}
echo "</table>";
?>
id='chk[]'should bename='chk[]'. What are you using to determine if a checkbox should be checked?if(!empty($_POST['chk[]']))but didn't really help