目前我正在使用html / servlet来显示表格,但效果非常无效,如下图所示。
查看税务信息显示mysql表中有值时的表格,如下所示:
如果用户希望对其进行编辑,则必须单击“编辑纳税信息”按钮,该按钮会显示以下内容:
有没有一种有效的方法来完成所有这些功能?就像这样:
示例代码:
HTML:
<?php
if (isset($_POST['submit_form'])) {
$file = preg_replace("/[^0-9a-z.\-_ ]/i", "", $_POST['file']);
$file_path = 'download/'. $file . '.zip';
if (file_exists($file_path)) {
header('Content-Disposition: attachement; filename=' . basename($file_path));
header('Content-Type: application/force-download');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Content-Length: ' . filesize($file));
header('Connection: close');
readfile($file);
}
else { echo "File not found"; exit; }
}
?>
<form action="" method="post">
<input type="text" name="file" placeholder="Enter filename here" />
<input type="submit" name="submit_form" value="Download starten" />
</form>
的Servlet
<div id="container">
<h1>Add Tax Bracket</h1>
<form action ="AddTax" method = "post">
<table border ="1">
<tr>
<td>Tax Bracket</td>
<td><input type = "number" name = "bracket" min="0" step="1" required></td>
</tr>
<tr>
<td>From Salary($)</td>
<td><input type = "number" name = "FromSalary" min="0" step="0.01" required></td>
</tr>
<tr>
<td>To Salary($)</td>
<td><input type = "number" name = "ToSalary" min="0" step="0.01" required></td>
</tr>
<tr>
<td>Tax Rate(%)</td>
<td><input type = "number" name = "rate" min="0" step="0.01" required></td>
</tr>
</table>
<br>
<br>
<input type = "submit" value = "Add Tax Bracket">
</form>
<h1>Remove Tax Bracket</h1>
<form action ="RemoveTax" method = "post">
<table border ="1">
<tr>
<td>Tax Bracket to remove</td>
<td><input type = "number" name = "bracket1" min="0" step="1" required></td>
</tr>
</table>
<br>
<br>
<input type = "submit" value = "Remove Tax Bracket">
</form>
</div>
</body>
</html>