psquillace Posted February 25, 2008 Share Posted February 25, 2008 Hello All: I am trying out a php script that involves sending checkboxes that people select to a mailing service called Constant Contact. For some reason, when you check multiple arrays only one option gets sent from that array... The last one checked... Can someone tell me if there is a limit an array or something like that. See, the array, when called lists all checkboxes that people can check but if someone checks more than one.... it does not pass or even get emailed because I have that in the script too. I would list the code here but it is 500 lines long with the HTML..... Thanks for any help or insight into this, Paul Quote Link to comment Share on other sites More sharing options...
p2grace Posted February 25, 2008 Share Posted February 25, 2008 The array size shouldn't be the problem. The syntax in your input tag should be like this though "name='check[]' or whatever name you want. But you need to have the brackets at the end. Let me know if that helps. Quote Link to comment Share on other sites More sharing options...
psquillace Posted February 26, 2008 Author Share Posted February 26, 2008 hrmm well, when I call the array I have this <?php if (count($list_array) == '1') { echo "<tr><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><input type=\"hidden\" name=\"list_name[]\" value=\"" . $list_array[0] . "\"></td></tr>"; }else { foreach($list_array as $list_name) { $list_html .= "<tr><td valign=\"top\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><input type=\"checkbox\" name=\"list_name[]\" value=\"" . $list_name . "\"></td><td valign=\"top\" style=\"padding-top:6px;\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">" . $list_name."</td></tr>"; } echo "<b>Please Select Your Products of Interest:</b><br>" . $list_html; } ?> Do yo mean the list_name[] that i have, it should be list_name='[]' instead? thanks for your help, Paul Quote Link to comment Share on other sites More sharing options...
DarkerAngel Posted February 26, 2008 Share Posted February 26, 2008 hrmm well, when I call the array I have this <?php if (count($list_array) == '1') { echo "<tr><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><input type=\"hidden\" name=\"list_name[]\" value=\"" . $list_array[0] . "\"></td></tr>"; }else { foreach($list_array as $list_name) { $list_html .= "<tr><td valign=\"top\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><input type=\"checkbox\" name=\"list_name[]\" value=\"" . $list_name . "\"></td><td valign=\"top\" style=\"padding-top:6px;\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">" . $list_name."</td></tr>"; } echo "<b>Please Select Your Products of Interest:</b><br>" . $list_html; } ?> Do yo mean the list_name[] that i have, it should be list_name='[]' instead? thanks for your help, Paul <?php if (count($list_array) == '1') { echo "<tr><td><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><input type=\"hidden\" name=\"list_name[]\" value=\"" . $list_array[0] . "\"></td></tr>"; }else { $i = 0; foreach($list_array as $list_name) { $list_html .= "<tr><td valign=\"top\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\"><input type=\"checkbox\" name=\"list_name[$i]\" value=\"" . $list_name . "\"></td><td valign=\"top\" style=\"padding-top:6px;\"><font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"1\">" . $list_name."</td></tr>"; $i++; } echo "Please Select Your Products of Interest: " . $list_html; } ?> see if that helps EDIT: forgot the ; after the $i++, I always do :-X Quote Link to comment Share on other sites More sharing options...
psquillace Posted February 26, 2008 Author Share Posted February 26, 2008 Thanks DarkAngel for all your help with this, I was informed by the nice people at Constant Contact that they do not allow multiple sign ups with one pass of a script but only one entry per. Now I have to go back and recreate this script with a foreach loop or something..... :-\ At least I know it was nothing in my code so that is sort of comforting, Thanks again for all your help, Paul 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.