This is because you are using ;
in every if
statement instead of if { .. }
statements try this code
<?php
if (isset($_POST['your_name'])) {
$your_name = $_POST['your_name'];
}
if (isset($_POST['your_email'])) {
$your_email = $_POST['your_email'];
}
if (isset($_POST['subject'])) {
$subject = $_POST['subject'];
}
if (isset($_POST['message'])) {
$message = $_POST['message'];
}
$to = "email.co.uk";
$subject = "New Message";
mail ($to, $subject, $message, "From: " . $your_name);
echo "Your message has been sent";
?>
1
solved php Contact Form Coding Issues [duplicate]