I'm working on some extensions to a 20 year old PHP code. Now I needed to add a new text input field and process the data as in all previously existing text input fields. Evrything works fine except for this new input.
I've got a HTML form:
<form action="form.php?<?php echo SID; ?>" method="post">
<?php echo "<div id=\"inputheader-title\"><input type=\"text\" name=\"".$new.$i.'[position_new]'."\" size=\"3\" maxlength=\"2\" value=\"".$i."\">. Entry</div>"; ?>
[...]
<input class="button" type="image" src="<?php echo $HTML_IMG; ?>/send.png">
</form>
[...] denotes further input fields, which are all working fine. All text input fields are using the same pattern.
The source code for the text field within my browser looks like this:
<input type="text" name="old1[position_new]" size="3" maxlength="2" value="1">
Which looks fine to me. But when I send the form data the value for old1[position_new] is always default in PHP's $_POST
. All other data is correct (as inserted into the form fields). I checked that with var_dump($_POST)
When I examine the data sent by the browser I can see the modified value, but when it comes to PHP the data seems altered, despite it isn't processed any further.
In short: I entered: 3
Default value is: ["position_new"]=> string(1) "1"
The browser shows: ["position_new"]=> string(1) "3"
var_dump($_POST) shows: ["position_new"]=> string(1) "1"