Getting name from Submit Button php -
basically making list of buttons , want single $_post['submit'] delete database depending on button pressed. there 2 values keep within submit button. thanks!
...while($row = mysqli_fetch_array($papertoreview)){ if ($row > 0) { echo '<td width = 200><input type=submit name=' . $row['uid'] . 'value=removerow />'; echo '</tr>'; }} if (isset($_post['submit']) && $_post['submit'] =='removerow'){ dbsubmit("delete paper_review paper_reviewer_id = '" ???submit button name???"' , paperid = '"???some other part of submit button"'");
you can't pass 2 values through $_post variable 1 form element. unless put them in value attribute, use php explode split values.
in html form have
<input type="submit" name="btnsubmit" value="valuea-valueb" />
then in php script
$data = explode('-', $_post['btnsubmit']);
now data array split data ($data[0] = 'valuea', $data[1]= 'valueb')
also, did not close <td>
tag in loop, did mean </td>
in second echo
? , width attribute not enclosed quotation marks, , deprecated.
Comments
Post a Comment