I want to know why the partsname and qty don't echo inside an email message body.
Here is my code:
<?php
include('../config.php');
$roomid = $_POST['roomid'];
$status=$_POST['status'];
$tc=$_POST['transactioncode'];
mysql_query("UPDATE athan_orders SET status='$status' WHERE id='$roomid'");
header("location: viewords.php");
mysql_query("SELECT * FROM athan_members where id='$roomid'");
$recepient=$_POST['id'];
mysql_query("SELECT * FROM orderdetails where transactioncode = '$tc'");
$partsname=$_POST['partsname'];
$qty=$_POST['qty'];
$to = "$recepient"; //enter the recipients email address here
$subject = "Order Confirmed"; //email subject
$message = "
<html>
<head>
<title>Order Confirmed</title>
</head>
<body>
<p>Your Order at Athan Motorcycles has been confirmed by the admin. Please contact the company for the details and verification of your order.</p>
<table>
<tr >
<td><div> Products</div></td>
<td>Qty</td>
</tr>
</table>
<tr>
<td>"echo "$partsname"";
<td>"echo "$qty"";
</td>
</td>
</tr>
<table>
<tr>
<th>Thank you!</th>
<th>-Athan Motorcycles</th>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>
</body>
</html>
";
// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "
";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "
";
// More headers
$fromemail = "melvin.napoles@yahoo.com"; //enter senders email address here
$headers .= "From: <". $fromemail . ">
";
//$ccemail = ""; //cc email address
//$headers .= "Cc: $ccemail" . "
";
if (mail($to,$subject,$message,$headers) == TRUE){
print "Success!";
}else{
print "Error!";
}
?>
so i query the parts name and qty from the order details and make a variable to them. then i inserted it inside the email form. Is it correct or there is something wrong from calling the variables?