JSHINER Posted January 14, 2008 Share Posted January 14, 2008 Using this: <select name="email" size="6" multiple="multiple" id="email"> <option value="[email protected]">James A. Shiner</option> <option value="[email protected]">Mike Smith</option> <option value="[email protected]">John Doe</option> </select> How can I get it to pass all selected to the next page formatted as "[email protected], [email protected]" - right now it just brings one of the over to the next page where it sends the email. Thanks! 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[]" 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? 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 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
Archived
This topic is now archived and is closed to further replies.