I've made my first attempt at making a php contact form but have come to a bit of a stand still.
I've tried making some forms required but failed miserably and also the email feild to detect if a correct email was entered, but again failed miserably!
If anyone could help that'd be great.
<?php
if(isset($_POST['submit'])) {
$to = "lee@klevermedia.co.uk";
$subject = "Contact form";
$name = $_POST['name'];
$email = $_POST['email'];
$company = $_POST['company'];
$contact = $_POST['contact'];
$dropdown = $_POST['dropdown'];
$message = $_POST['message'];
$header="from: $name_field <$email>";
$body = "From: $name\n\n E-Mail: $email\n\n Company: $company\n\n Contact number: $contact\n\n Drop down: $dropdown\n\n Message:\n\n $message";
echo "Your email has been sent to $to";
mail($to, $subject, $body, $header);
}
else {
header('Location: http://www.klevermedia.co.uk') ;
}
?>
Help






















