I’m using dynamic forms in my project, the input field’s id increments by 1 each time a new field set is called:
<input type="text" id="billing_id1" />
<input type="text" id="billing_id2" />
In the processor how would I go about submitting all data, because the following code is only submitting the first field set…
processor:
$billing_id = empty($_POST['billing_id']) ? die ("ERROR: Billing ID was not submitted") : mysql_escape_string($_POST['billing_id']);
$connection = mysql_connect($mysql_server, $mysql_user, $mysql_pass) or die("Could not connect to database");
mysql_select_db($mysql_db) or ("Unable to select database");
$query = "INSERT INTO customer_contacts (billing_id) VALUES ('$billing_id')";
$result = mysql_query($query) or die ("ERROR: $query. ".mysql_error());
Hope someone can help, thanks
If you use square brackets instead:
You’ll get an array instead of individual values