Can someone please explain this to me?
I have the following code:
<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>
This works fine on my main dev box, and on the server. However, I’m having to work remotely on my laptop at the moment. I’ve installed the exact same WAMPServer 2.1a build as on my dev setup, and the $_POST array is empty.
If I declare the field like:
<input type="text" name="testField" />
I get the expected output.
From the HTML 4.01 specification, §17.2, "Controls":
"id" does not matter.