[Solved] how to put value in buttons? [closed]


So this is very crude, but it is one way you can do what you are trying to do:

<table>
<?php
while($row=mysql_fetch_array($check2)) {
?>
<tr>
  <td><?php echo $row['wTitle']; ?></td>
  <td>Click to edit</td>
</tr>
<tr>
  <td style="text-align:right;"><?php echo $row['wContent']; ?></td>
</tr>
<tr>
  <td colspan="2" height="202">&nbsp;</td>
</tr>
<tr>
  <td colspan="2">
    <form action="view.php" method="post">
      <input type="submit" name="submit" value="edit" />
      <input name="workId" type="hidden" value="<?php echo $row[workId]; ?>" />
    </form>
  </td>
</tr>
<?php } ?>
</table>

and this assumes your view.php script looks for the workId querystring parameter and if it is present, uses it to edit the record. Your table looks very odd (no headers for example), so you might want to look again at the layout.

One of the better solutions to these Create/Update/Delete requirements is to write a REST API and use AJAX (perhaps via jQuery) to perform them; but I have a feeling this is outside your ability.

3

solved how to put value in buttons? [closed]