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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -