Coinnoch Posted September 20, 2009 Share Posted September 20, 2009 Yes, I know. This is very common noob question...(and yes, I know I shouldn't be using REQUEST) Here's my code: $parking[] = $_REQUEST['parking']; while(list($key, $val) = each($parking)) { $print_parking .=$val .= " "; } Oddly, this code worked fine on netfirms servers, but when I moved to hostpapa it now only emails 'ARRAY' instead of the values entered. I tried removing the [] but that just throws an error if the user doesn't select anything (the field is optional). Can any of you code gurus fix my code? Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/174848-emailing-checkbox-data/ Share on other sites More sharing options...
MadTechie Posted September 20, 2009 Share Posted September 20, 2009 i assume it worked without the [], but you got the error, try this if(!empty($_REQUEST['parking'])) { $parking = $_REQUEST['parking']; while(list($key, $val) = each($parking)) { $print_parking .=$val .= " "; } } Quote Link to comment https://forums.phpfreaks.com/topic/174848-emailing-checkbox-data/#findComment-921446 Share on other sites More sharing options...
Coinnoch Posted September 20, 2009 Author Share Posted September 20, 2009 Wow. Thanks for your quick response. That worked! Quote Link to comment https://forums.phpfreaks.com/topic/174848-emailing-checkbox-data/#findComment-921448 Share on other sites More sharing options...
MadTechie Posted September 20, 2009 Share Posted September 20, 2009 Your welcome, and welcome to PHP Freaks responses here are normally in minute to hours, just remember to rules Now this thread is solved can you click "Topic solved" bottom left, (it saves other opening this thread hoping to help and finding it solved ) and Happy PHPing Quote Link to comment https://forums.phpfreaks.com/topic/174848-emailing-checkbox-data/#findComment-921450 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.