Hello Everybody
Well i have a table which has a check box in every row , what i want to do is to delete more than one row at a time , now i handled the code to delete one row every time ,but i need to delete the checked row !
So how i can i do it using php ?
Thank you for your help .
Need Help
Moderator: General Moderators
Re: Need Help
In your form, name all the checkboxes like an array, and give each one a different value. For example,
When this form is submitted to your PHP script, $_POST['rows'] will be an array of whichver values have been checked. For example, if I check only Item 1 & 3, then my $_POST['rows'] will contain an array containing '1' and '3'.
Code: Select all
<input type="checkbox" name="rows[]" value="1" /> Item 1
<input type="checkbox" name="rows[]" value="2" /> Item 2
<input type="checkbox" name="rows[]" value="3" /> Item 3Code: Select all
var_dump($_POST['rows']);Code: Select all
array(2) {
[0]=>
string(1) "1"
[1]=>
string(1) "3"
}