This is a two part question. Someone answered a similar question the other day (which also contained info about this type of array in PHP), but I cannot find it.
1.
Here’s some PHP and JavaScript demonstration code that shows a simple way to create indexed fields on a form (fields that have the same name) and then process them in both JavaScript and PHP. The fields must have both "ID" names and "NAME" names. Javascript uses the ID and PHP uses the NAME.
";
echo "";
?>
";
echo "";
$DQ = '"'; # Constant for building string with double quotes in it.
if (isset($_POST["MyButton"])) {
$TheNameArray = $_POST["TheName"]; # Use NAME in PHP
echo "Here are the names you submitted to server:
";
for ($i = 0; $i <3; $i++) {
echo $TheNameArray[$i] . "
";
}
}
echo "Enter names and submit to server or Javascript
";
echo "";
echo "";
echo "";