dimanche 9 août 2015

How to check the checkbox values of every row in table

Well, i can check the checkbox values using an array in the name tag of checkbox- like below: And in xx.php i can receive it by:

$chks = $_POST['chkbox'];
foreach($chks as $k) { echo $k; }

But if i have a html table with 2 columns. one with id from database , another with checkboxes. So,in each row- beside each id i have a checkbox.

What if i want to post the id & checkbox values and receive in another php file. Then i want to check every value of checkbox against the id's?

Basically i was trying to make array for both id & checkbox. And in xx.php file, loop through the id array and if there is any value of checkbox array at that index than show it. But it doesnt work.

Any solutions?




Aucun commentaire:

Enregistrer un commentaire