<?php
echo $_REQUEST["test"];
?>
<form method='post' action='1.php'>
<input type='text' id='test' name='test'>
<input type='submit' onclick="javascript:window.alert('提交成功')">
</form>
echo $_REQUEST["test"];
?>
<form method='post' action='1.php'>
<input type='text' id='test' name='test'>
<input type='submit' onclick="javascript:window.alert('提交成功')">
</form>
也可以在form标签中添加 onsubmit 事件