有人可以向我解释一下吗?
@H_403_1@我有以下代码:
<form action="<?PHP echo $_SERVER['PHP_SELF']; ?>" method="post"> <input type="text" id="testField" /> <input type="submit"> </form> <br /><br /> <pre> <?PHP print_r($_POST); ?> </pre>@H_403_1@这在我的主开发盒和服务器上工作正常.但是,我现在不得不在我的笔记本电脑上远程工作.我安装了与我的开发设置完全相同的WAMPServer 2.1a版本,$_POST数组为空. @H_403_1@如果我声明这样的字段:
<input type="text" name="testField" />@H_403_1@我得到了预期的输出.
从HTML 4.01规范,§17.2,“Controls”:
@H_403_1@A control’s “control name” is given by its name attribute. @H_403_1@… @H_403_1@When a form is submitted for processing,some controls have their name paired with their current value and these pairs are submitted with the form.@H_403_1@“id”并不重要.