我将所有这些代码放在一个文件中:index.php:
<table id="tbl" class = "table table-bordered table-responsive ">
<thead>
<th>Segment</th>
<th>Action</th>
</thead>
<tbody>
<?php
require 'class.php';
$conn = new db_class();
$read = $conn->read();
while($fetch = $read->fetch_array()){
?>
<tr>
<td><?php echo $fetch['segment']?></td>
<form action="activate.php" method="post">
<input type="hidden" name="id" value="<?php echo $id?>">
<td><center><button class = "btn btn-default" name="update"><a href=""></a><span class = "glyphicon glyphicon-edit"></span> Update</button> | <button class = "btn btn-success" name="activate"><span class = "glyphicon glyphicon-check"></span> Activate</button></center></td>
</form>
</tr>
<?php
}
?>
</tbody>
我需要知道的是如何将更新按钮更改为保存按钮,并将<td>
字段更改为输入字段,并进行更改。谢谢大家。