PHP - Contact Form Problem

ThomasHardy

Free Member
Jan 24, 2008
280
21
I am currently developing a site and the contact form just wont work...

http://development.thomashardy.me.uk/contact.html


Code:
<?php
if(isset($_POST['submit'])) {

    $to = "[email protected]";
    $subject = "Contact Form";
    $name_field = $_POST['name'];
    $email_field = $_POST['email'];
    $message = $_POST['message'];

    foreach($_POST['check'] as $value) {
        $check_msg .= "Checked: $value\n";
    }
    
   $body = "From: $name_field\n E-Mail: $email_field\n $check_msg Message: $message\n";

    echo "Data has been submitted to $to!";
    mail($to, $subject, $body);
    
} else {
    echo "blarg!";
}
?>
Can anyone shed any light on where I am going wrong?
 

Latest Articles

Join UK Business Forums for free business advice