// this is the html code that would go out to the browser, note that I only have 1 Form
<form action="formhandler.php4" method="POST">
// here is area for form 1, it contains all form variables for it
<input type="text" name="form_data[form1][field1]">
<input type="text" name="form_data[form1][field2]">
<input type="text" name="form_data[form1][field3]">
<input type="text" name="form_data[form1][field4]">
<input type="submit" name="form_buttons[form1]">
// here is area for form 2, it contains all form variables for it
<input type="text" name="form_data[form2][field1]">
<input type="text" name="form_data[form2][field2]">
<input type="text" name="form_data[form2][field3]">
<input type="text" name="form_data[form2][field4]">
<input type="submit" name="form_buttons[form2]">
</form>
// now the script actually handles the info and determines what to do
// here is the pseudo code to do it
formhandler.php
<?
// there is a variable called $form_data as an array holds all the field values
// there is a variable called $form_buttons as an array holds all the button values
if (isset($form_buttons["form1"]))
{
// user submited form1 process on data and echo same form
echo $form_data["form1"]["field1"]; // echoes what the user typed in field 1
// etc...
}
if (isset($form_buttons["form2"]))
{
// user submited form1 process on data and echo whatever is next page
echo $form_data["form2"]["field1"]; // echoes what the user typed in field 2
// etc...
// code here should generate page or redirect to the wanted page....
}
?>
Saludos
Gerardo