PDA

View Full Version : Can't find solution


gigiloumill
09-22-2010, 01:53 AM
O.K. guys, this one I just can't find. I set up a form to collect info and I included a check box group option. All info filled is being sent to an e mail as well as to a database. While testing, the form is sending info as it should but, I have a problem; the problem is that the check box group is only sending one option back..I can't find the solution. does anyone have any idea. To see the testing form please go here: http://survey.cfgfla.com/BotR.php. Thanks.

edbr
09-22-2010, 02:27 AM
name=looking_for[] will send the post as an array

gigiloumill
09-22-2010, 02:33 AM
I knew you would always come through. E, I am still a litle confused. Can you please explain further? Do I reset info in mail handling form as well as db sending form? Thanks

edbr
09-22-2010, 03:13 AM
in the form each value of the checkbox name as above it will be collected in your scripts as a foreach value for example. probably at the moment it will show the first value. this should collect it if your script doesnt already


foreach($_POST['looking_for'] as $value) {
$looking_for .= "$value\n";
}

gigiloumill
09-22-2010, 11:21 AM
E, I have tried but all I seem to be getting is the same field back twice. Here's code. Can you tell me what I'm doing wrong please? Thanks$mail->Body = "Name : " .$name . "\n" . "E_mail : " . $e_mail . "\n" . "Suite : " . $suite . "\n" . "Age : " . $age . "\n" . "Gender : " . $gender . "\n" . "Attended : " . $attended . "\n" . "Reason : " . $reason . "\n" ."Areas_used_most : " . $areas_used_most ."\n" . "Other_area : " . $other_area ."\n" . "Looking_for : " . $looking_for . "\n" . "Other_programs : " . $other_programs ."\n" . "Reason_to_attend : " . $reason_to_attend . "\n" . "Outside_member : " . $Outside_member . "\n" . "Where_enrolled : " . $Where_enrolled . "\n" . "Personal_trainer : " . $Personal_trainer . "\n" . "How_times : " . $how_times . "\n" . "Fees : " . $fees . "\n" . "Gender_trainer : " . $gender_trainer . "\n" . "Time : " . $time . "\n" . "Rate_gym : " . $rate_gym . "\n" . "Needed : " . $needed . "\n" . "Looking_for_classes : " . $looking_for_classes . "$aerobics\n" . "Looking_for_classes : " . $looking_for_classes . "$zumba\n" . "Other_class : " . $other_class . "\n" . "Feedback : " . $feedback;

This is the only one I keep getting back: "Looking_for_classes : " . $looking_for_classes . "$zumba\n"

gigiloumill
09-22-2010, 01:34 PM
Never mind E. I got it. I had to give the options numbers: 1,2,3,4,5, and on..Thank you for your help.

edbr
09-23-2010, 01:34 AM
welcome sorry i didnt have time to get back