I'm quite new too PHP and I'm trying to make a contact from containing a name text box, an email box some checkboxes and a comment section.
I have made everything work except the checkboxes, as you can see from the script below, it will send the information to my email, however I don't understand how to make the checkboxes appear in the email.
In other words, it will not tell me what boxes have been checked in the email. Any simple solution to this?
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$from = 'From: Website';
$to = 'example@mail.com';
$subject = 'Order';
$body = "From: $name
E-Mail: $email
Packages: $cbox
Message: $message";
?>
<label><strong>Name</strong></label>
<input name="name" type="text" placeholder="Type Here">
<label><strong>Email</strong></label>
<input name="email" type="email" placeholder="Type Here">
<label><strong>Packages</strong></label>
<input id="checkbox" type="checkbox" name="cbox" value="Logo">Logo</input>
<input id="checkbox" type="checkbox" name="cbox" value="Website">Website+Domain</input>
<input id="checkbox" type="checkbox" name="cbox" value="Other">Other</input>
<label><strong>Message</strong></label>
<textarea name="message" placeholder="Type Here"></textarea>
<input id="submit" name="submit" type="submit" value="Submit">
</form>
<?php
if ($_POST['submit']) {
if (mail ($to, $subject, $body, $from)) {
echo '<p>Your message has been sent!</p>';
} else {
echo '<p>Something went wrong, go back and try again!</p>';
}
}
?>