sending different email format to different address

Hi all, I’m a total beginner in PHP, Basically I want to make an order form and when buyer click the submit button, they’ll see thank you message displayed on their web browser and an order confirmation is sent to their email as well.

I’ve made two 2 email formats, $theResults will be displayed on web browser after buyer click the submit button and $theReply will be sent to their email address, but I’m seeing this error message http://www.crystalashley.co.nz/order-form/contactformprocess-edit.php , does anybody know what’s wrong with my code? please helpp…Thanks a lot

[php]<?PHP

/* SUBJECT AND EMAIL VARIABLE */
$emailSubject = ’ crystal ashley order form - squares ';
$webMaster = '[email protected], [email protected] ';

/* gathering data variable */

$emailField = $_POST['email'] ;
$nameField = $_POST['name'] ;
$phoneField = $_POST['phone'] ;
$codeField = $_POST['code'] ;
$quantityField = $_POST['quantity'] ;
$hearField = $_POST['hear'] ;
$classField = $_POST['class'] ;
$commentsField = $_POST['comments'] ;



$body = <<<EOD





Email : $email

Name : $name

Phone : $phone

Code : $code

Hear from : $hear

Interested in : $class

Comments : $comments



EOD;
$headers = "From : $email\r\n";
$headers = "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);

/results rendered as html/
$theResults = <<<EOD

crystal ashley form
Thank you for your interest! Your email will be answered very soon!
$theReply = <<<EOD
crystal ashley form
Thank you for your interest! Your order confirmation will be sent very soon!

EOD;
$headers = “From : $webMaster\r\n”;
$headers = “To : $recipient\r\n”;
$headers .= “Content-type: text/html\r\n”;
$success = mail($recipient, $emailSubject, $theReply, $headers);

echo “$theResults”;

?>

[/php]

$emailfeild = $email

either put one or the other
you have
$emailfeild = $_POST[email]
then
email : $email
as a variable not $emailfield

$mail = null

so should be the same
[php]$emailfield = $_post[email]
email : $emailfield[/php]

Forgot to say you would want to sanatise those $_POST[FIELDS]
Or someone might hack your server or send spam or alsorts of nasty things can happen

Sponsor our Newsletter | Privacy Policy | Terms of Service