我想提交一個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