ken0213 Posted July 13, 2010 Share Posted July 13, 2010 I'm having a hard time to show the value of the checkbox in the email..... The results of the checkbox are showing an "array". Here is part of the html and php code: html: <input type="checkbox" name="chkbox[]" value="Product A" />Product A <input type="checkbox" name="chkbox[]" value="Product B" />Product B <input type="checkbox" name="chkbox[]" value="Product C" />Product C php: $To="[email protected]"; $Send=$_POST["Email"]; $subj="Inquiries"; $msg="Contact Person:"."\t".$_POST["Contact_Person"]."\n"."Email:"."\t\t".$_POST["Email"]."\n"."."Skype:"."\t".$_POST["skype"]."\n"."MSN:"."\t".$_POST["MSN"]."'\n"."Which product you are interested: "."\n".$_POST ['chekbox']."\n\n"."Message:"."\n".$_POST["message"]; echo "Dear ".$_POST["Contact_Person"]."</p>"; $mail_header="From:$Send"; ini_set("SMTP","xxxxxxxxx.net"); $success=mail($To,$subj,$msg,$mail_header); if($success) { }else{ echo "<font color='red'>An unexpected error has occurred! Please try again.</p>"; } ?> Link to comment https://forums.phpfreaks.com/topic/207589-how-to-show-the-result-of-checkbox-in-the-email/ Share on other sites More sharing options...
TOA Posted July 13, 2010 Share Posted July 13, 2010 The results of the checkbox are showing an "array". Thats because you're storing it as an array (which is used for multiple selections--not sure if that's your intention). Try calling a specific key inside the array (btw...call the name, not the type, and check your spelling) or just define it as a variable instead of an array Make any sense? :-\ Link to comment https://forums.phpfreaks.com/topic/207589-how-to-show-the-result-of-checkbox-in-the-email/#findComment-1085289 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.