Thanks for the response.
I am a definitely a novice.
Im using a pre-existing form from a template and the template developer made the following suggestion:
" Give unique ids to the inputs and use the ids on global variable (for ex. $_POST['your_id']). "
Ive made the id edits as suggested, but still no results in email:
<input type="checkbox" id="b1" name="vehicle[]" value="Bike">I have a bike<br>
<input type="checkbox" id="b2" name="vehicle[]" value="Car">I have a car
<input type="checkbox" id="b3" name="vehicle[]" value="Walk">I walk
<select class="form-control" name="choose" id="choose">
<option>1</option>
<option>2</option>
<option>3</option>
</select>
PHP:
<?php
if(empty($_POST['name']) ||
empty($_POST['email']) ||
empty($_POST['message']) ||
!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
{
echo "No arguments Provided!";
return false;
}
$vehicles = implode(', ', $_POST['vehicles'] );
$choose = $_POST['choose'];
$name = $_POST['name'];
$email_address = $_POST['email'];
$website = $_POST['website'];
$message = $_POST['message'];
// Create the email and send the message
$to = '
[email protected]'; // Add your email address inbetween the '' replacing
[email protected] - This is where the form will send a message to.
$email_subject = "Website Contact Form: $name";
$email_body = "You have received a new message from your website contact form.
\n\n"."Here are the details:
\n\nName: $name
\n\nType: $vehicles
\n\nChoice: $choose
\n\nEmail: $email_address
\n\nWebsite: $website
\n\nMessage:\n$message";
$headers = "From:
[email protected]\n"; // This is the email address the generated message will be from. We recommend using something like
[email protected].
$headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers);
return true;
?>
Thanks for your help.