hey guys, im a bit new to php. I was wondering if any of you guys could help me out with this email code i have to send me an email. I have a website with a service link then the user needs to pick which kind of service he/she requires. Everything works except the checkbox part. It sends me an email and it's blank there. Here is my code:
<?
include("../header.php");
$name= $_POST['name'];
$from = $_POST["email"];
$to = "je@example.com";
$subject = "Proposal Request";
$message = "Company Name: " . $_POST["companyname"] . "\n";
$message .= "Telephone Number:" . $_POST["telephonenumber"] . "\n";
$message .= "Email Address:" . $_POST["email"] . "\n";
$message .= "Company Name:" . $_POST["companyname"] . "\n";
$message .= "Company Address:" . $_POST["location"] . "\n";
$message .= "City:" . $_POST["city"] . "\n";
$message .= "State:" . $_POST["state"] . "\n";
[B]$message .= "Type of Service needed:" . $_POST["service[]"] . "\n";[/B]
$message .= "Best Time to Contact:" . $_POST["time[]"] . "\n";
$message .= "Contact by Email/Phone:" . $_POST["cpref[]"] . "\n";
if($sent){
$headers = 'From: ' . $name . ' <' . $from . '>' . "\r\n" .
'Reply-To: ' . $from . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
echo "The Email Has Been Sent";
}
?>
<div style="position: absolute; left:149px; top:320px;">
<table bgcolor="#ffffff" width="800" border="0">
<tr>
<td>
<div align="center">
<p> </p>
<p><img src="proposalssign.jpg" width="92" height="29" />
</p>
</div>
<p> </p>
<p> </p>
<table width="680" border="0" align="center">
<tr>
<td>Need a Free Quote for your company? Not a problem just fill out the indicated boxes below, and we'll be sure to give you a call within the next 24 hours. </td>
</tr>
</table>
<p>
<!-- Begin Proposal Form -->
<form enctype="multipart/form-data" method="post" action="proposal.php" accept-charset="UTF-8">
<input type="hidden" name="sent" value="1" />
<table cellspacing="5" cellpadding="5" border="0">
<tr>
<td valign="top">
<strong>Name:</strong>
</td>
<td valign="top">
<input type="text" name="name" id="name" size="40" value="" />
</td>
</tr>
<tr>
<td valign="top">
<strong>Telephone Number:</strong>
</td>
<td valign="top">
<input type="text" name="telephonenumber" id="telephonenumber" size="40" value="" />
</td>
</tr>
<tr>
<td valign="top">
<strong>Email Address:</strong>
</td>
<td valign="top">
<input type="text" name="email" id="email" size="40" value="" />
</td>
</tr>
<tr>
<td valign="top">
<strong>Company Name:</strong>
</td>
<td valign="top">
<input type="text" name="companyname" id="companyname" size="40" value="" />
</td>
</tr>
<tr>
<td valign="top">
<strong>Company Address:</strong>
</td>
<td valign="top">
<input type="text" name="location" id="location" size="40" value="" />
</td>
</tr>
<tr>
<td valign="top">
<strong>City:</strong>
</td>
<td valign="top">
<input type="text" name="city" id="city" size="40" value="" />
</td>
</tr>
<tr>
<td valign="top">
<strong>State:</strong>
</td>
<td valign="top">
<input type="text" name="state" id="state" size="40" value="" />
</td>
</tr>
<tr>
<td valign="top">
<strong>What kind of service are you looking for?</strong>
</td>
<td valign="top">
<input type="checkbox" name="service[]" id="service_0" value="One-Time Scrub Down" /> One-Time Scrub Down<br/>
<input type="checkbox" name="service[]" id="service_1" value="Daily Maintenance" /> Daily Maintenance<br/>
<input type="checkbox" name="service[]" id="service_2" value="Weekend Maintenance" /> Weekend Maintenance<br/>
</td>
</tr>
<tr>
<td valign="top">
<strong>What's the best time to contact you at?</strong>
</td>
<td valign="top">
<input type="checkbox" name="time[]" id="time_0" value="Morning" />Morning<br/>
<input type="checkbox" name="time[]" id="time_1" value="Afternoon" />Afternoon<br/>
<input type="checkbox" name="time[]" id="time_2" value="Evening" />Evening<br/>
</td>
</tr>
<tr>
<td valign="top">
<strong>What is the preferred method to contact you?</strong>
</td>
<td valign="top">
<input type="checkbox" name="cpref[]" id="cpref_0" value="Email" />Email<br/>
<input type="checkbox" name="cpref[]" id="cpref_1" value="Phone" />Phone<br/>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value=" Submit Form " />
</td>
</tr>
</table>
</form>
<!-- End Proposal Form --><br /><br />