Forum Moderators: coopster
<?php if($_POST['url'] != "") {
echo('
<p class="error">
You may be using a text-only browser or you are a spambot. Your message has not been submitted.
</p>
');
}
else {
if(isset($_POST['name'])) {
if(($_POST['name'] == "") or ($_POST['email'] == "") or ($_POST['message'] == "")) {
echo('
<p class="error">
all fields are required.
</p>'
);
}
else {
$name = $_POST['name'];
$email = $_POST['email'];
$formmessage = ($_POST['message']);
$emailmessage = "You have received a submission from your contact form.
Name: $name
Email: $email
Message: $formmessage
";
//Defining mail settings
$to = "admin@somewebsite.com";
$CCUser = $_POST['email'];
$subject = "Message from $name via SomeWebsite.com";
$headers = "From: $email";
if(isset($name)) {
mail($to,$CCUser,$subject,$emailmessage,$headers);
}
}
}
}
?>
<?php if(isset($name)) {
echo('
<div class="contactnote">
<p class="success">
You message has been successfully sent.
<br /><br />
Please allow 24-48 hours for a response. If it has been more than 24 hours and you still have not received a response, please try sending your message again.
</p>
</div>'
);
} ?> even though the form returns saying that the message was successfully sent.