As soon as submit is pressed the value of everything in the form is assigned to a variable that you can use insert into on.
So if you got
<input type="text" name="namehere">
Then upon clicking submit whatever is in that textfield is assigned the the variable $namehere.
Just use
if ($submit)
{
$query = mysql_query("insert ...
}
to get it into the db.
Note, to be compatible with PHP5+, or PHP5- with globalvars off use
if ($_POST['submit'])
and use $_POST['namehere'] to access the variables.