pan1138 Posted December 6, 2006 Share Posted December 6, 2006 Hi - [b]here is a snippet of the form mail HTML code:[/b][code]<tr> <td><img name="n99are_you_broker" src="images/99are_you_broker.jpg" width="233" height="24" border="0" id="n99are_you_broker" alt="Are you a Real Estate Broker?" /></td> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="12%"><input name="ckbox" type="checkbox" onClick="javascript:checkBoxValidate(0)" value="yes_broker"></td> <td width="29%"><img src="images/yes.jpg" alt="Yes" width="35" height="15" /></td> <td width="14%"><input name="ckbox" type="checkbox" onClick="javascript:checkBoxValidate(1)" value="no_broker"></td> <td width="45%"><img src="images/no.jpg" alt="No" width="27" height="14" /></td> </tr> </table></td> </tr> <tr> <td><img name="cont99brokerage_r16_c2" src="images/cont99brokerage_r16_c2.jpg" width="233" height="24" border="0" id="cont99brokerage_r16_c2" alt="Brokerage Company" /></td> <td><input name="brokerage" type="text" id="brokerage" value="" size="22" /></td> </tr> <tr> <td colspan="2"><img name="n99required" src="images/99required.jpg" width="446" height="23" border="0" id="n99required" alt="* Required Fields" /></td> </tr> <tr> <td colspan="2"><INPUT TYPE=image SRC="images/99submit.jpg" ALIGN=bottom></td> </tr> <tr> <td colspan="2"><img name="contact_form99_r19_c2" src="images/contact_form99_r19_c2.jpg" width="446" height="65" border="0" id="contact_form99_r19_c2" alt="" /></td> </tr> </table>[/code][b]Here is the PHP:[/b][code]<?php$subject="You just received an email from www.website.com : Contact Form";$recepient ="[email protected]";$body = "<br><strong>First Name:</strong> </strong> ".$_REQUEST['first_name']."<br><strong>Last Name:</strong> ".$_REQUEST['last_name']."<br><strong>Email:</strong> ".$_REQUEST['email']."<br><strong>Address:</strong> ".$_REQUEST['addr1']."<br><strong>Apt/Suite/Box:</strong> ".$_REQUEST['apt_suite']."<br><strong>City:</strong> ".$_REQUEST['city']."<br><strong>State:</strong> ".$_REQUEST['state']."<br><strong>Zip Code:</strong> ".$_REQUEST['zip']."<br><strong>Country:</strong> ".$_REQUEST['country']."<br><strong>Telephone:</strong> ".$_REQUEST['phone']."<br><strong>Email:</strong> ".$_REQUEST['email']."<br><strong>Residence Type:</strong> ".$_REQUEST['residence_type']."<br><strong>Price Range:</strong> ".$_REQUEST['price_range']."<br><strong>Where Did You Hear About Us?:</strong> ".$_REQUEST['heard_about']."<br><strong>Are you A Broker?:</strong> ".$ckbox."<br><strong>Brokerage Company:</strong> ".$_REQUEST['brokerage'];$email = $_REQUEST['email'];ini_set("SMTP","mail.website.com"); ini_set("smtp_port","25"); ini_set("sendmail_from","[email protected]"); mail($recepient,$subject,$body,"FROM: $email\nContent-Type: text/html");echo("<META HTTP-EQUIV='Refresh' CONTENT='0;URL=http://www.website.com'>");?> [/code]-checkedThe [b]Are You A Broker?[/b] line in the PHP is what I need to display in the boy of the email - [b]yes_checked[/b] or [b]no_checked[/b]Any wizard out there see any glaring errors? The checkbox info is not displaying - it is a Yes or No (2 boxes) same name (ckbox) with 2 different check values..HELP PLEASE ??? Link to comment https://forums.phpfreaks.com/topic/29616-need-to-send-checkbox-results-in-body-of-an-email/ Share on other sites More sharing options...
drifter Posted December 6, 2006 Share Posted December 6, 2006 name your check boxes different, or use radio buttons Link to comment https://forums.phpfreaks.com/topic/29616-need-to-send-checkbox-results-in-body-of-an-email/#findComment-135905 Share on other sites More sharing options...
pan1138 Posted December 6, 2006 Author Share Posted December 6, 2006 please clarify if you could, I am a little lost... Link to comment https://forums.phpfreaks.com/topic/29616-need-to-send-checkbox-results-in-body-of-an-email/#findComment-135906 Share on other sites More sharing options...
drifter Posted December 6, 2006 Share Posted December 6, 2006 FROM - http://w3schools.com/html/html_forms.aspRadio ButtonsRadio Buttons are used when you want the user to select one of a limited number of choices.[code]<form><input type="radio" name="sex" value="male"> Male<br><input type="radio" name="sex" value="female"> Female</form>[/code]How it looks in a browser:MaleFemaleNote that only one option can be chosen.CheckboxesCheckboxes are used when you want the user to select one or more options of a limited number of choices.[code]<form><input type="checkbox" name="bike">I have a bike<br><input type="checkbox" name="car">I have a car</form>[/code] Link to comment https://forums.phpfreaks.com/topic/29616-need-to-send-checkbox-results-in-body-of-an-email/#findComment-135923 Share on other sites More sharing options...
pan1138 Posted December 6, 2006 Author Share Posted December 6, 2006 Thanks Drifter - I changed the checkboxes to radio buttons and fixed the php and it worked perfectly!Thanks for the quick replies! Link to comment https://forums.phpfreaks.com/topic/29616-need-to-send-checkbox-results-in-body-of-an-email/#findComment-135930 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.