所以我有这个代码,它是行的删除按钮,但是除了第一个按钮,它作为值idk的提交按钮时,它的工作方式完美。我已经失去了如何将它们放在他们的位置(在删除下)以及如何修复第一个按钮
代码:
echo "<tr>";
echo "<td>". $row["id"] . "</td>";
echo "<td></td>";
echo "<td>". $row["shelllink"] . "</td>";
echo "<td>". $row["shellprice"] . "</td>";
echo " <form action='delete.php' method='post' class='deletePHP'>
<input type='hidden' name='id' value='".$row['id']."'/>
<input type='submit' name='delete' value='delete'/>
</form>";
echo "</tr>";
}
echo "</table>";
现在表格的情况:
<div class="content">
<form action="shellinsert.php" method="post">
<p>
<label for="firstName">Link:</label>
<input <input type="url" name="shelllink" required/ size="160"><br>
</p>
<p>
<label for="firstName">Price:</label>
<input <input type="number" name="shellprice" required/ min="1" max="1000" size="160"><br>
</p>
<input type="submit" value="Submit">
答案 0 :(得分:1)
表格行中的所有内容都必须位于<td></td>
内。
echo " <td><form action='delete.php' method='post' class='deletePHP'>
<input type='hidden' name='id' value='".$row['id']."'/>
<input type='submit' name='delete' value='delete'/>
</form></td>";