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 Quote Link to comment 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> Quote Link to comment Share on other sites More sharing options...
gtrufitt Posted March 14, 2008 Author Share Posted March 14, 2008 Thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.