You haven't given enough information for a proper answer, but assuming you have multiple forms all submitting to the same server-side page then add a "hidden" field to the form to indicate the source. Read the value of the hidden field in your page to know what form submitted it and change the destination address based on that.
<input type="hidden" value="form1" />