Hi,
I created a php form with a bunch of text areas. When the page loads up, the text areas are populated by data from a database. Everything is divided in sections and in every section there are about a dozen definitions. For every section I have 2 Submit buttons: "Add Section"(sbm_Add_Section) and "Remove this Section"(sbm_Remove_Section), and for every defnition I have 2 more submit buttons: "Add Definition"(sbm_Add_Def) and "Remove this Definition"(sbm_Remove_Def), so the user can add or remove data and then submit it. Of course I have a loop that gets the data from the db, first the it gets the section and then all the definitions from that section, then it goes to next section and so on. Every submit button is assigned a number by using an index key(array), like this:
<input type="submit" name="sbm_Add_Section [<?php echo $i;?>"]" value="Add Section">
This is done so I can detect which button has been clicked on, so if "sbm_Add_Section[4]" has been clicked the page will reload and it will add a new section after that. If "sbm_Add_Def[5]" is clicked, the page will reload and it will add an empty field after Definition 5 so the user can enter something and then he can submit it to the database.
Everything worked fine until I got a new version of PHP(4.2.2). Now I have to use $_POST to get the values. So now I have to do this:
$sbm_Add_Section[$i] = $_POST['sbm_Add_Section'][$i];
When I print $sbm_Add_Section[$i], for some reason it prints me 'Add Section'. This is the value of the button, it's what I want written on the button. Does anybody know why it does this? Where am I suppose to put the value of the index key?