use one insert with multiple groups of values - much much faster than using an insert for each line of values. google for insert multiple rows
insert into ... (fieldname, fieldname,...) values (line0_fieldval0, line0_fieldval1, line0_fieldval2), (line1_fieldval0, line1_fieldval1, line1_fieldval2) ad nauseum
using a single insert with 30k lines of values would cause a response timeout but on your submission form but you could just use a javascript loop on the form to repeatedly call a php function until you've processed all 30k