Hi,
Thanks for replying. As I say I have no
PHP knowledge at all at the moment so I just pasted your suggested code in to my mailer.
php file but now when I post the form I get this message:
Quote:
|
Parse error: syntax error, unexpected T_VARIABLE in /home/fhlinux163/a/anyoldirons.me.uk/user/htdocs/mailer.php on line 14
|
Can you tell me exactly where I should paste your code in relation to my
PHP below and whether I need to remove anything from it?
- PHP: Select all
<?php
if(isset($_POST['submit'])) {
$to = "xxxxxxxxxx@hotmail.com";
$subject = "Matchday Programmes";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];
$body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message";
echo "Data has been submitted to $to!";
mail($to, $subject, $body);
} else {
echo "blarg!";
}
?>
Thanks & Rgs
Craig