Hello
I am trying to send mail to customer with the details of product they brought but the code which I have written not showing the value of variable total_list
Actually I need to send email regarding the product details purchased by user if they purchased more than 1 product then user must get 1 mail with all products detail
For this I am trying to do like this
$cart = $_SESSION['cart'];
$items = explode(',',$cart);
$result = count($items);
$total_list='';
for ($i=0; $i<$result; $i++)
{
//echo $items[$i];
orderconfirm($items[$i]);
}
function orderconfirm($productid)
{
$cus_id = $_SESSION['own_email'];
$pro_id = $productid;
$result = mysql_query("SELECT * FROM products where id = '$pro_id'");
if($row = mysql_fetch_array($result))
{
$subject = $row['Subjects'];
$main_proname = $row['mainproduct'];
$proname = $row['p_name'];
$prodetail = $row['details'];
$proprince = $row['prince'];
}
$holder = $_POST['holder'];
$bank = $_POST['bank'];
$branch = $_POST['branch'];
$ac_no = $_POST['ac_no'];
$cheqdate = $_POST['cheqdate'];
$cheq_no = $_POST['cheq_no'];
$total_amount = $_POST['tota_amount'];
$total_list = $proname.'-'.$main_proname.'-'.$proprince.'<br />';
/* $qry = "INSERT INTO `sales_data`(`cust_id` , `subject` , `pro_id` , `mainproduct` , `pro_name` , `prince` , `bank` , `cheque_no` , `holder_name` , `branch` , `ac_no` , `cheqdate` , `paid` )
VALUES ('$cus_id', '$subject', '$pro_id', '$main_proname', '$proname', '$proprince', '$bank', '$cheq_no', '$holder', '$branch', '$ac_no', '$cheqdate', 'no')";
echo $qry;
$coloer1 = '';
if (!mysql_query($qry))
{
die('Error: ' . mysql_error());
} */
}
echo $total_list;
//unset($_SESSION['cart']);
//$_SESSION['cart']=='';
//echo "1 record added";
//header("Location: thankyou.php");
//exit();
?>
Thank you all