JSHINER Posted January 14, 2008 Share Posted January 14, 2008 Using this: <select name="email" size="6" multiple="multiple" id="email"> <option value="james@site1.com">James A. Shiner</option> <option value="james@site2.com">Mike Smith</option> <option value="jshiner@site3.com">John Doe</option> </select> How can I get it to pass all selected to the next page formatted as "james@site2.com, james@site3.com" - right now it just brings one of the over to the next page where it sends the email. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/85995-solved-passing-multiple-variables-from-one-form-field/ Share on other sites More sharing options...
PFMaBiSmAd Posted January 14, 2008 Share Posted January 14, 2008 The name="..." parameter needs to be an array - name="email[]" Quote Link to comment https://forums.phpfreaks.com/topic/85995-solved-passing-multiple-variables-from-one-form-field/#findComment-439138 Share on other sites More sharing options...
JSHINER Posted January 14, 2008 Author Share Posted January 14, 2008 Ok now on the next page that just receives that as "Array" I have this to format correctly send: $send_to = str_replace(" ",",", $email); What am I missing? Quote Link to comment https://forums.phpfreaks.com/topic/85995-solved-passing-multiple-variables-from-one-form-field/#findComment-439143 Share on other sites More sharing options...
kenrbnsn Posted January 14, 2008 Share Posted January 14, 2008 Use the implode() function: <?php $sendto = implode(',',$_POST['email']); echo $sendto; ?> Ken Quote Link to comment https://forums.phpfreaks.com/topic/85995-solved-passing-multiple-variables-from-one-form-field/#findComment-439147 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.