Hi, I am having issues capturing data from the checkboxes in my form. I can't figure out what code needs to go into the php file for multiple selections.
The rest of the form is fine so I have left out most of the coding. Below is my html code for the checkboxes and my full php code as it stands.
Any guidance/code would be greatly aprpeciated. Thanks in advance!
Hi, I am having issues capturing data from the checkboxes in my form. I can't figure out what code needs to go into the php file for multiple selections.
The rest of the form is fine so I have left out most of the coding. Below is my html code for the checkboxes and my full php code as it stands.
Any guidance/code would be greatly aprpeciated. Thanks in advance!
HTML Code
PHP Code <?php $EmailFrom = "myemail@email.com"; $EmailTo = "myemail@email.com"; $Subject = "Registration; $Fullname = Trim(stripslashes($_POST['Fullname'])); $Email = Trim(stripslashes($_POST['Email'])); $Session = Trim(stripslashes($_POST['Session'])); // validation $validationOK=true; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">"; exit; } // prepare email body text $Body = ""; $Body .= "Fullname: "; $Body .= $Fullname; $Body .= "\n"; $Body .= "Email: "; $Body .= $Email; $Body .= "\n"; $Body .= "Session: "; $Body .= $Session; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){ print ""; } else{ print ""; } ?>
Try putting the code in the given "Code" tag when posting. That post is a jumbled mess and I don't even want to attempt to decipher it! :P
Fixed some of it.
Checkbox's return yes or no as a value. You would have to have 3 unique names for each checkbox and use PHP to see which returned YES or NO.