Problem with code...
| From: | Jason Pruim | Date: | Fri, 07 Oct 2011 00:28:00 +0000 |
| Subject: | Problem with code... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-315156@lists.php.net to get a copy of this message | ||
Hi everyone,
Have a question about this block of code....
<?PHP
//SETUP VARIABLES
$mailTo = "lists@pruimphotography.com";
$mailFrom = "lists@pruimphotography.com";
//These 2 can be changed IF you know what you are doing and why!
$returnPath = $mailFrom;
$replyTo = $mailFrom;
$mailSubject = "New Convention registration!";
$message = "";
//DO NOT CHANGE UNDER PENALITY OF BEING SLAPPED WITH A WET NOODLE!!!
$headers = "From: ".$mailFrom."\n";
$headers .= "Return-Path: ".$returnPath."\n";
$headers .= "Reply-To: ".$replyTo."\n";
function send_email($mailTo, $mailSubject, $mailMessage, $headers) {
if(mail( $mailTo, $mailSubject, $mailMessage, $headers )) {
$message = "Thank you for registering!";
}else {
echo "There was an issue with your registration.. Please try again later";
}
}//Close Function
if(!empty($errorCount)) {
}else {
//Build Email message
$mailmessage = "Full Name: " . $_POST['firstname'] . " " .
$_POST['lastname'] . "\n\n";
$mailmessage .= "Address: " . $_POST['address'] . "\n\n";
$mailmessage .= "City, State, Zip: " . $_POST['city'] . "
" . $_POST['state'] . " " . $_POST['zip'] . "\n\n";
$mailmessage .= "Phone: " . $_POST['phone'] . "\n\n";
$mailmessage .= "Email address: " . $_POST['email'] .
"\n\n";
if($_POST['affiliation'] == "NFBOther") {
$mailmessage .= "Chapter Affiliation: " . $_POST['other'] .
"\n\n";
}else{
$mailmessage .= "Chapter Affiliation: " . $_POST['affiliation']
. "\n\n";
}
if($_POST['person'] =="Other"){
$mailmessage .= "Who will pick up the ticket? " .
$_POST['Pfirstname'] . " " . $_POST['Llastname'] . "\n\n";
}else{
$mailmessage .= "Who will pick up the ticket? I will pick it up my self!
\n\n";
}
$mailmessage .= "Payment Method: " . $_POST['paymentMethod'];
send_email($mailTo, $mailSubject, $mailmessage, $headers);
}
?>
Sometimes... It is dropping the last $mailmessage line... The payment method in the actual email it
sends...
Anyone have any ideas? I'm stumped....
Jason Pruim
lists@pruimphotography.com