Hey, I am trying to make a fairly simple php contact form, this is what I have so far though it just goes to a totally blank page after hitting submit, can anyone tell me where I am going wrong? Thanks!
<?php
if (isset($_POST['submit'])) {
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$from = 'From:'.$email;
$to = '[email protected]';
$subject = 'Hello';
$body = "From: $name\n E-Mail: $email\n Message:\n $message";
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>';
}
}
?>