retrieving array values from a checkbox php -
i'm having trouble seeing wrong here. trying delete database based on checkboxes have been checked. if(!empty($_post['removecheckbox'])) says removecheckbox empty though when echo $currentrow[] shows values. in advance.
while($row = mysqli_fetch_array($papertoreview)){ if ($row > 0) { $currentrow = array($row['uid'], $row['toreview']); echo $currentrow[0]; echo $currentrow[1]; echo '<td width = 200><input type="checkbox" name="removecheckbox[]" value="'.$currentrow.'"> remove</td>'; } } //remove button echo'<td width = 200><td width = 200><td width = 200><td width = 200><td width = 200><input type=submit name=submit value="remove checked rows"></td>';
and here see if remove button has been checked , through of checked boxes.
if (isset($_post['submit']) && $_post['submit'] =="remove checked rows"){ if(!empty($_post['removecheckbox'])) { //deletes row database foreach($_post['removecheckbox'] $check) { dbsubmit("delete paper_review paper_reviewer_id = '" . $check[0] ."' , paperid = '" . $check[0] ."'"); } }
are sure, sumbiting condition met ?
check if have right values in $_post variable, simple write this, before submit condition
echo(<pre>); print_r($_post); echo(</pre>);
please send more code (how create form, in post variable)
t.
Comments
Post a Comment