php noob!!! PLEASE HELP ME!!!!!?

Jeff

New member
So i have been trying to get my contact form to work, but nope... no luck anyone care to pick my code apart?

<?php

$EmailFrom = "[email protected]";
$EmailTo = "[email protected]";
$Subject = "Contact Form Submission";

$Name = Trim(stripslashes($_POST['name']));
$Email = Trim(stripslashes($_POST['email']));
$Website = Trim(stripslashes($_POST['website']));
$Phone = Trim(stripslashes($_POST['phone']));
$Budget = Trim(stripslashes($_POST['budget']));
$StartDate = Trim(stripslashes($_POST['start_date']));
$Referrer = Trim(stripslashes($_POST['referrer']));
$Details = Trim(stripslashes($_POST['details']));
$Websites = Trim(stripslashes($_POST['websites']));
$Contact = Trim(stripslashes($_POST['contact']));

// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Current Website: ";
$Body .= $Website;
$Body .= "\n";
$Body .= "Phone: ";
$Body .= $Phone;
$Body .= "\n";
$Body .= "Project Budget: ";
$Body .= $Budget;
$Body .= "\n";
$Body .= "Start Date: ";
$Body .= $Date;
$Body .= "\n";
$Body .= "How did you hear about us: ";
$Body .= $Referrer;
$Body .= "\n";
$Body .= "Details: ";
$Body .= $Details;
$Body .= "\n";
$Body .= "Competitors: ";
$Body .= $Websites;
$Body .= "\n";
$Body .= "Contact Method: ";
$Body .= $Contact;
$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\">";
}
?>
 
Back
Top