I have been trying to figure this out for some time now. I think I'm making it harder than it's supposed to be. For some reason it's not passing values to my email but I do get an email.
Code:
<?php
include("connection.php");
$SQL = "SELECT * FROM product_offer WHERE id = ".$_REQUEST['id']."";
$exe = mysql_query($SQL);
$row = mysql_fetch_array ($exe);
?>
<?php
$SELect = "SELECT * FROM product_offer ORDER BY id DESC LIMIT 1";
$Query_exe = mysql_query($SELect);
if($PRO_id = mysql_fetch_array($Query_exe)) {
?>
<?php
$customer_price = $_POST['customer_price'];
$email = $_POST['email'];
$client_name = $_POST['client_name'];
$contact_number = $_POST['contact_number'];
$toEmail = "[email protected]";
$subject = "Junk Car ";
$message = "Thank you for accepting our offer";
$body = "
-----------------------------------------------------------------------------
WEBSITE CONTACT ENQUIRY
-----------------------------------------------------------------------------
Customer Price : $customer_price
Email : $email
Name : $client_name
Contact Number : $contact_number
Message = $message
____________________________________
End of Email
";
$topHeader = "From: $email\n";
$topHeader . "MIME-Version: 1.0\n"
. "Content-Transfer-Encoding: 7bit\n"
. "Content-type: text/html; charset = \"iso-8859-1\";\n\n";
if(mail($toEmail,$subject, $body, $topHeader))
{
echo "<center><b>Congratulation, you have successfully submitted your information. We will Contact you within 24 Hours. <br /> You will be redirected shortly or click on following link. <a href='index.html'> Home </a> <b></center>";
}
?>
<?php
$thanks = "Thank you for submission";
}
?>