mjurmann Posted March 16, 2008 Share Posted March 16, 2008 Hello, I'm trying to pass multiple checkbox values from a form to the next page (a mail script). Even when multiple checkboxes are selected, the e-mail sent out via the script on the form action's destination page only includes the last checked item. How can I include all of the checkbox values? Here is the code I was using on the mail script page: <?php if (is_array($_POST['program'])){ $TrainingProgram = implode(', ', $_POST['program']);} else { $TrainingProgram = $_POST['program']; }?> Thanks so much. Quote Link to comment Share on other sites More sharing options...
thebadbad Posted March 16, 2008 Share Posted March 16, 2008 All your check boxes should have the name "program[]" in order for your code to work. Quote Link to comment Share on other sites More sharing options...
mjurmann Posted March 16, 2008 Author Share Posted March 16, 2008 You. Are. Awesome. Thank you so much! Quote Link to comment Share on other sites More sharing options...
thebadbad Posted March 16, 2008 Share Posted March 16, 2008 Of course I am, I knew you missed the brackets without even seeing your HTML! 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.