Simple man...

You have a select box with the various section names like so

Code:
<?
session_start();
if(session_is_registered(your_session_name_here)){
//
//
//
//The above is to secure the form.  So not just anyone can use it
//
//
//
//
?>
<form name=some_form id=some_form action="http://some_url.com">
   <select name=select_name>
     <option value=1>Section 1</option>
     <option value=2>Section 2</option>
     <option value=3>Section 3</option>
   </select>
<!--
The rest of the form elements for db entry go here
-->
<input type=submit value=submit>
<?
//
//closing out the session { below
//
}
//
//
//
?>
Then on the page the form data is sent to...

Code:
<?
//
//Below is here so no on can submit using a URL hack
//
session_start();
if(session_is_registered(your_session_name_here)){

//
//
//Start checking for sections and processing data
//
//
  if($section_name == "1"){
  $dg = mysql_query(INSERT into Table_name (feild1, feild2, feild3,)VALUES ('$form_feild1', '$form_feild2', '$form_feild3'));
  if($dg){
?>
  <center>
   Insert sucessful, you will be re-directed now.
  <meta refresh=you_know_the_deal>
<?
  }else{
?>
  There is a issue at this time.  Please try back later.
<?
echo "error ".mysql_error();
//rember to remove this when the script is 100% ready
?>
  }

//
//
//Second section process
//
//
}else if($section == "2"){
  $dg = mysql_query(INSERT into Table_name2 (feild1, feild2, feild3,)VALUES ('$form_feild1', '$form_feild2', '$form_feild3'));
  if($dg){
?>
  <center>
   Insert sucessful, you will be re-directed now.
  <meta refresh=you_know_the_deal>
<?
  }else{
?>
  There is a issue at this time.  Please try back later.
<?
echo "error ".mysql_error();
//rember to remove this when the script is 100% ready
?>
  }
}
?>
Now to save yourself some time you could write a function. The coolest thing in php is the ability to write your own commands. Sooooo you can take this...
Code:
  if($section_name == "1"){
  $dg = mysql_query(INSERT into Table_name (feild1, feild2, feild3,)VALUES ('$form_feild1', '$form_feild2', '$form_feild3'));
  if($dg){
?>
  <center>
   Insert sucessful, you will be re-directed now.
  <meta refresh=you_know_the_deal>
<?
  }else{
?>
  There is a issue at this time.  Please try back later.
<?
echo "error ".mysql_error();
//rember to remove this when the script is 100% ready
?>
  }

//
//
//Second section process
//
//
}else if($section == "2"){
  $dg = mysql_query(INSERT into Table_name2 (feild1, feild2, feild3,)VALUES ('$form_feild1', '$form_feild2', '$form_feild3'));
  if($dg){
?>
  <center>
   Insert sucessful, you will be re-directed now.
  <meta refresh=you_know_the_deal>
<?
  }else{
?>
  There is a issue at this time.  Please try back later.
<?
echo "error ".mysql_error();
//rember to remove this when the script is 100% ready
?>
  }
}
?>
and turn it into this


Code:
insetion_cmd($table_name $section);
See this link for info.
http://us2.php.net/manual/en/functions.php#functions.user-defined


Functions can save you tons of time. On tradebikes for example I have one function that creates drop down and/or text boxes on the fly on all forms. It sets the CSS attributes and populates the drop downs all dynamicaly.


one drop down menu can be minimum 7 lines of code. I have it trimed down to one. and with a slight change it can be several other form elements. I trimed about 500+ lines off each bike entry page this way.
_________________________
My New site OpenEyes