<form action="checkout.php" method="POST">
<!-- this won't get submitted despite being named -->
<input type="button" name="button1" value="a button">
<!-- this one does; so the input's TYPE is important! -->
<input type="submit" name="submit1" value="a submit button">
</form>
处理上述表单操作的PHP脚本(checkout.php):
<?php var_dump($_POST); ?>
在你的本地机器上,通过在/tmp/ Test /文件夹中创建这两个文件,然后从shell运行内置的PHP web服务器来测试上面的内容: