Hi
I have 1 form that I need to split into two. Currently all the data gets stored into a database.
I pass the data entered from page 1 to page 2 through the use of hidden fields. I have having trouble carrying across multiple checkbox values.
I'll start by explaining the form. It is an order samples form. So 1 person can order multiple samples. The samples ordered goes into a database on a new row as my client monitors how many samples are ordered.
Here is the layout of the checkboxes:
<input name="sample[]" type="checkbox" value="Sample1">
<input name="sample[]" type="checkbox" value="Sample2">
<input name="sample[]" type="checkbox" value="Sample3">
<input name="sample[]" type="checkbox" value="Sample4">
and heres my code to insert into the database
foreach ($_POST['sample'] as $value) {
$foo = mysql_query("Insert into table SET sample ='$value', othervalues.........);
The checkboxes will remain on page 1 and the other fields will go to page 2...
How can I carry the checkbox value to page two... then process the form and insert into the database?
Hope this makes sense...
hope someone can help
Thanks