I’m trying to create a contact form on a client’s site, but get the following message when it’s been submitted:
Parse error: syntax error, unexpected T_VARIABLE in
as32ent\domains\s\hisdomain.com\user\htdocs\mailer.php on line 9
I’ve used the kirupa tutorial to create it. This is line 9:
$body = “From: $name_field
E-Mail: $email_field
Message:
$message”;
And this is the whole php file:
<?php
if(isset($_POST[‘submit’])) {
$to = "infoline@hisdomain.com";
$subject = “Contact Form”;
$name_field = $_POST[‘name’];
$email_field = $_POST[‘email’];
$message = $_POST[‘message’];
$body = “From: $name_field
E-Mail: $email_field
Message:
$message”;
echo “Thank you. Your message has been submitted to $to!”;
mail($to, $subject, $body);
} else {
echo “please try again”;
}
?>
Your help is much appreciated.