HTML & PHP - How to make multiple forms submittable

christymoose

New Member
I have the following code which loops through an array to create forms that are filled with values (which the user will be able to edit) on a single page. There are as many forms as there are loops in the array, which is always changing.\[code\]<body><div id="main"> <?php foreach($articles as $item) { ?> <div id='container'> <form> Title: <input type="text" name="title" size="80" value="http://stackoverflow.com/questions/14073867/<?php echo $item[0]; ?>"> <br> URL: <input type="text" name="url" size="80" value="http://stackoverflow.com/questions/14073867/<?php echo $item[1]; ?>"> <br> End Date: <input type="text" name="endDate" value="http://stackoverflow.com/questions/14073867/<?php echo substr($item[7], 14, strpos($item[7],'@') - strlen($item[7])); ?>"> <br> <?php if (substr($item[8], 0, 2) === 'Su'){ } else { ?> Start Date: <input type="text" name="startDate" value="http://stackoverflow.com/questions/14073867/<?php echo substr($item[8], 7, 9); ?>"> <?php } ?> </form> </div> <?php } ?></div></body>\[/code\]Now, I want the user to have a single submit button at the bottom of the page which will submit ALL the forms on the page to MySQL database. The problem is I don't know how to do that.I know the submit button takes the format of\[code\]<input type="submit" value="http://stackoverflow.com/questions/14073867/Submit">\[/code\]I am assuming I need to give each form in the loop a unique name but from there I am at a loss as to what my next step should be to actually send and receive the information from these multiple forms.Any help would be appreciated. Thanks.
 
Back
Top