0) { $msg = "Either you hit Submit more then once or you have already submitted a pickup request on this vehicle."; } else { $numberq = mysql_query("SELECT * FROM phc_numbering WHERE location='".$location."'")or die(mysql_error()); $nresult = mysql_num_rows($numberq); if ($nresult < 1 ) { $nquery = "INSERT INTO `phc_numbering` (`location`, `count`) VALUES ('".$location."', '1')"; $result = mysql_query($nquery)or die(mysql_error()); $ncount = 1; } else { $nresult = mysql_fetch_array($numberq); $ncount = $nresult['count'] + 1; $update = mysql_query("UPDATE phc_numbering SET count='".$ncount."' WHERE location='".$location."'")or die(mysql_error()); } $_POST['tracking_id'] = "C" . str_pad($ncount, 8, "0", STR_PAD_LEFT) . "-" . $location; $query = "INSERT INTO `".$table."` ("; $trigger = 0; foreach($_POST as $field => $value){ if($trigger > 0){ $query = $query . ", "; } $query = $query . $field; $trigger++; } $query = $query . ") VALUES (trim('"; $trigger = 0; foreach($_POST as $field => $value){ if($trigger > 0){ $query = $query . ", trim('"; } $value = str_replace(",", "", $value); $value = str_replace("\'", "", $value); $value = str_replace("\\", "", $value); $query = $query . $value."')"; $trigger++; } $query = $query . ");"; $result = mysql_query($query)or die(mysql_error()); // 5/3/12 Send e-mail to us so we know there is a donation if($_POST['donation_agent'] != 'Web') { $mrsmith = "This donation was submitted by an agent."; } else { $mrsmith = "This donation was submitted through the web site."; } $thefname = $_POST['requiredFirstName']; $thelname = $_POST['requiredLastName']; $thefullname = $thefname . " " . $thelname; $thedphone = $_POST['requiredHome_Phone']; $thedemail = $_POST['requiredEmail']; $thedcity = $_POST['requiredCity']; $thedstate = $_POST['requiredState']; $thedzip = $_POST['requiredZip_Code']; $thedtype = $_POST['requiredType']; $thedyear = $_POST['requiredYear']; $thedmake = $_POST['requiredMake']; $thedmodel = $_POST['requiredModel']; $thedcolor = $_POST['requiredColor']; $thedvin = $_POST['requiredVehicle_Identification_Number']; $thedmilage = $_POST['mileage']; $theloc = $_POST['requiredState']; $thedno = $_POST['tracking_id']; $okname = "Purple Heart Cars (phcars.org)"; $dondate = date("F-d-Y g:iA T"); $email_contents = "Tracking ID: $thedno\n"; $email_contents .= "Donated To: Purple Heart Cars\n"; $email_contents .= "Donation Date: $dondate \n"; $email_contents .= "$mrsmith\n\n"; $email_contents .= "Type: $thedtype Donation\n"; $email_contents .= "Vin: $thedvin\n"; $email_contents .= "Year: $thedyear\n"; $email_contents .= "Make: $thedmake\n"; $email_contents .= "Model: $thedmodel\n"; $email_contents .= "Color: $thedcolor\n"; $email_contents .= "Milage: $thedmilage\n"; $email_contents .= "Location: $thedcity, $thedstate, $thedzip\n"; $subject = "PHC-Donation: " . $thedno; $extra_headers .= "From: PHC Donation Form \r\n"; //$to = 'ab@domain.com' . ', '; // note the comma //$to .= 'ab@domain.com' . ', '; // note a second comma //$to = 'dmastrianni@purpleheartfoundation.org'; $to = 'wallen@purpleheartfoundation.org'; mail($to,$subject,"$email_contents",$extra_headers); // mail the user the information $email = $don_email; include '../pickup_form_mail.php'; $subject = $mailSubj; $message = $mailMessage; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: $mailFrom\r\n"; // if (in_array($location, $a)) { // $headers .= "BCC: donate@purpleheartcars.org\r\n"; // } mail($email, $subject, $message, $headers); $msg = "Thank you. Your donation pickup request has been submitted."; $donated = "yes"; } } ?> Purple Heart Cars : Purple Heart Foundation | Donate My Car, Truck, Boat or RV to Purple Heart Cars
 ".$headerstate."
"; } else { echo "
 ".$headerstate."
"; } ?>