hgbarrett Posted March 20, 2007 Share Posted March 20, 2007 I have a website with a "join our mailing list" form that shows up on all pages of the website. It has input for just someone's email address. It is inserted on each web page via an include file. In this website is a contact page that has it's own feedback form with name, email address and comments inputs. Both forms are coded very much the same. The problem is that when the submit button is pressed for either of the forms, it also triggers the processing of the other form. I am very new to php so I am not sure how to distinguish one form from the other so that only one form gets processed upon pressing the submit button. I don't know if it's done with $_POST or the submit button or what. I am hoping that this is an easy problem to solve and that someone out there is quite familiar with it. Any ideas would be appreciated. Thanks. Link to comment https://forums.phpfreaks.com/topic/43486-solved-problem-with-2-forms-on-one-page-submitting-same-time/ Share on other sites More sharing options...
monk.e.boy Posted March 20, 2007 Share Posted March 20, 2007 give each submit button a different name, so the email button should be called <input type="submit" name="change_email" > then in php you can: if( isset( $_POST['change_email'] ) ) { // update the users email } then do the same with the other form. monk.e.boy Link to comment https://forums.phpfreaks.com/topic/43486-solved-problem-with-2-forms-on-one-page-submitting-same-time/#findComment-211189 Share on other sites More sharing options...
hgbarrett Posted March 20, 2007 Author Share Posted March 20, 2007 Works like a charm. Thanks a ton for your help! Link to comment https://forums.phpfreaks.com/topic/43486-solved-problem-with-2-forms-on-one-page-submitting-same-time/#findComment-211559 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.