gtrufitt Posted March 14, 2008 Share Posted March 14, 2008 Hi, I have multiple forms on one page that are used to UPDATE a user's information, each form has its own submit button and the action is <?php echo $SERVER['PHP_SELF']; ?> to bring the form back to the page. I am slightly unsure of the code needed to process each from depending which one has been changed eg: if (the form name) has been changed UPDATE something else if (another form name) has been changed UPDATE something different etc. What is the correct php code to use with the if statement in order to update each form depending on which form has been changed? Thanks, Gareth Link to comment https://forums.phpfreaks.com/topic/96193-help-processing-diffrent-forms-on-one-page-using-if-statement/ Share on other sites More sharing options...
soycharliente Posted March 14, 2008 Share Posted March 14, 2008 <?php if (isset($_POST['Submit1'])) { // do me! } else if (isset($_POST['Submit2'])) { // no me! } else if (isset($_POST['Submit3'])) { // what about me? } ?> <form> <!-- the form --> <input type="Submit" name="Submit1" value="Submit1" /> </form> <form> <!-- the form --> <input type="Submit" name="Submit2" value="Submit2" /> </form> <form> <!-- the form --> <input type="Submit" name="Submit3" value="Submit3" /> </form> Link to comment https://forums.phpfreaks.com/topic/96193-help-processing-diffrent-forms-on-one-page-using-if-statement/#findComment-492455 Share on other sites More sharing options...
gtrufitt Posted March 14, 2008 Author Share Posted March 14, 2008 Thank you Link to comment https://forums.phpfreaks.com/topic/96193-help-processing-diffrent-forms-on-one-page-using-if-statement/#findComment-492467 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.