我想提交一个form
(或请求)来完成一些任务。除了submit
按钮,form
没有输入字段。提交没有输入字段的表单。
我知道这有点奇怪,但我想通过只使用php提交表单并获取数据。
这可能吗?
我的代码
if($_GET['submitImage']){
//do the stff I want......
}
<form id='formSubmitImage' name='submitImage' method='get' action='cm_ct_generate_preview.html'>
<?php
echo "<table>";
echo "<th>ID</th>";
echo "<th>Type</th>";
echo "<th>Name</th>";
echo "<th>Image</th>";
foreach($tests as $test){
echo '<tr>';
echo '<td>';
echo $test['ID'];
echo '</td>';
echo '<td>';
echo $test['Type'];
echo '</td>';
echo '<td>';
echo $test['Name'];
echo '</td>';
echo '<td>';
echo $test['FileName'];
echo '</td>';
echo '</tr>';
}
echo "</table>";
echo "<input type='submit' value='Set Images'></input><br>";
?>
</form>
是否有另一种方式做到这一点?非常感谢!
恕我直言,这味道不好,你应该使用标签Do命令在应用程序的行为和形式。 – 2013-06-28 20:20:22