Contact Form Trouble
Posted: Fri Apr 30, 2010 12:37 pm
Hello, I am trying to get a contact form to work (http://businesscalcium.com/contact.html) but when the form submits I get an error "Parse error: syntax error, unexpected T_STRING in /var/www/web3/web/contactengine.php on line 42"
Here's the code for contactengine.php:
Anybody know what's causing the syntax error?
Here's the code for contactengine.php:
Code: Select all
<?php
// CHANGE THE THREE VARIABLES BELOW
$EmailFrom = "***email removed***";
$EmailTo = "***email removed***";
$Name = Trim(stripslashes($_POST['name']));
$Email = Trim(stripslashes($_POST['email']));
$Company = Trim(stripslashes($_POST['company']));
$Phone = Trim(stripslashes($_POST['phone']));
$Subject = Trim(stripslashes($_POST['subject']));
$Message = Trim(stripslashes($_POST['message']));
// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Phone: ";
$Body .= $Phone;
$Body .= "\n";
$Body .= "Company: ";
$Body .= $Company;
$Body .= "\n";
$Body .= "Subject: ";
$Body .= $Subject;
$Body .= "\n";
$Body .= "Message: ";
$Body .= $Message;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
// CHANGE THE URL BELOW TO YOUR "THANK YOU" PAGE
if ($success){
print "<meta http-equiv="refresh" content="0;URL=contactthanks.html">";
}
else{
print "<meta http-equiv="refresh" content="0;URL=error.html">";
}
?>