justlukeyou Posted April 30, 2011 Share Posted April 30, 2011 Lets say a website is dedicated to two different people (Bob and Richard). The site has a contact page in which people can email the two people. Is it possible to create a form in which someone can enter a message but there are two submission options. So in this example there are two images. One reads "Send Email to Bob" and the other reads "Send Email to Richard". Is it possible to do this or to have two submission methods from one form? Quote Link to comment https://forums.phpfreaks.com/topic/235208-one-form-two-submissions/ Share on other sites More sharing options...
wildteen88 Posted April 30, 2011 Share Posted April 30, 2011 Yes a form can have multiple submit buttons. <?php if(isset($_POST['bob_submit'])) { echo "send message to bob"; } elseif(isset($_POST['richard_submit'])) { echo "send message to richard"; } ?> <form action="" method="post"> <input type="submit" name="bob_submit" value="Send to Bob" /> Or <input type="submit" name="richard_submit" value="Send to Richard" /> </form> Quote Link to comment https://forums.phpfreaks.com/topic/235208-one-form-two-submissions/#findComment-1208737 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.