use a hidden variable in each form to tell which action to do.
i.e. each separate form embed this.
form name=products method=post action=$php_self
input type=hidden name=form_number1 value=form1_action
...
...
...
input type=submit name=Submit value=Submit
then do an if to decide which form was
rewrite your FORM tags to have a name and a onSubmit() handler like:
FORM NAME=f1 METHOD=... ACTION= onSubmit()=return
formSubmitted(this);
Now inside each of your forms, have a hidden field named form_name like
input type=hidden name=form_name
Now put the following code within the