Di Nimkii Posted January 29, 2017 Share Posted January 29, 2017 Yes, Im trying to have multiple forms on one web page. Then when you submit each one have php differentiate between which form submitted the results.. to process and output what its processed. All on one page! Hint: I know you give <form> and id.. but hopefully you dont need javascript and can use php to check the name of the form, so it responds differently with each forms results. Thank you Link to comment Share on other sites More sharing options...
dsonesuk Posted January 29, 2017 Share Posted January 29, 2017 Give the submit button a unique name to identify that specific form Link to comment Share on other sites More sharing options...
Ingolme Posted January 29, 2017 Share Posted January 29, 2017 Just use inputs in the form to identify it. In form 1: <input type="hidden" name="action" value="form1"> In form 2: <input type="hidden" name="action" value="form2"> On the server side: $action = isset($_POST['action']) ? $_POST['action'] : ''; switch($action) { case 'form1': // Do processing for form 1 break; case 'form2': // Do processing for form 2 break; default: echo 'Invalid form'; } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now