How to make multiple-form with single submit button and action with php

harrvester

New Member
Rather inputing one by one for a class/lessen for a day, I'd like to input 10 forms at once.The HTML is something like this.All the form do the same thing, add start_time, finish_time and instructor in a database.However I am not sure how to do this. And I am not sure if this HTML is correct or not.Any inputs will be appreciated.Thanks in advance.HTML\[code\]<?php$date = "2010-10-08";?><form name="form1" method="post" action="inputform.php"> <!-- form 1 --><label for='start_time'>1. Start Time</label><input type="text" name="start_time" /><label for='finish_time'>Finish Time</label><input type="text" name="finish_time" /><label for='instructor'>Instructor</label><select name="instructor"><option value="http://stackoverflow.com/questions/3896120/john">John</option><option value="http://stackoverflow.com/questions/3896120/mary">Mary</option><option value="http://stackoverflow.com/questions/3896120/jim">Jim</option></select><input type="hidden" name="date" value="http://stackoverflow.com/questions/3896120/<?php echo $date; ?>"/><div style="clear: both;">&nbsp;</div><!-- form 2 --><label for='start_time'>2. Start Time</label><input type="text" name="start_time" /><label for='finish_time'>Finish Time</label><input type="text" name="finish_time" /><label for='instructor'>Instructor</label><select name="instructor"><option value="http://stackoverflow.com/questions/3896120/john">John</option><option value="http://stackoverflow.com/questions/3896120/mary">Mary</option><option value="http://stackoverflow.com/questions/3896120/jim">Jim</option></select><input type="hidden" name="date" value="http://stackoverflow.com/questions/3896120/<?php echo $date; ?>"/><div style="clear: both;">&nbsp;</div><!-- form 3 --><label for='start_time'>3. Start Time</label><input type="text" name="start_time" /><label for='finish_time'>Finish Time</label><input type="text" name="finish_time" /><label for='instructor'>Instructor</label><select name="instructor"><option value="http://stackoverflow.com/questions/3896120/john">John</option><option value="http://stackoverflow.com/questions/3896120/mary">Mary</option><option value="http://stackoverflow.com/questions/3896120/jim">Jim</option></select><input type="hidden" name="date" value="http://stackoverflow.com/questions/3896120/<?php echo $date; ?>"/><div style="clear: both;">&nbsp;</div><!-- form 4,5,6,7,8,9,10 --><input type="submit" name="submit" value="http://stackoverflow.com/questions/3896120/Submit" /></form>\[/code\]
 
Back
Top