我正在做一個表格,當用戶檢查一行與檢查按鈕,他可以刪除或更新它......但只有刪除按鈕work.I不知道如何在同一個表單中創建兩個提交按鈕。我想按去delete.php和更新按鈕走兩頭update.php時刪除按鈕......下面是我的形式...如何使提交按鈕,刪除和更新在相同的形式,php
<form name="form1" method="post" action="delete.php">
<table >
<th>
<th ><strong>Emri </strong></th>
<th ><strong>Pershkrimi </strong></th>
<th><strong>Ora</strong></th>
</th>
<?php
while ($row=mysql_fetch_array($result)) {
?>
<tr>
<td ><input name="checkbox[]" type="checkbox" value="<?php echo $row['Id_Akt']; ?>"></td>
<td style="font-size:0.9em"><?php echo $row['Emri']; ?></td>
<td ><?php echo $row['Pershkrimi']; ?></td>
<td><?php echo $row['Ora']; ?></td>
</tr>
<?php
}
?>
</table>
<input class="button" name="delete" type="submit" value="Fshij" style="margin-left:4%; margin-top:50px; width:15%">
<br>
<input class="button" name="update" type="button" value="Update" style="margin-left:4%; margin-top:20px; width:15%" >
</form>
請幫助me.Thanks提前
你可以這編寫一個intermediate.php,它根據點擊的按鈕決定導航哪個地方。就像if buttonClicked ='delete'then goto delete.php else goto update.php – Habrashat
不要使用 optional