help needed for php email
Posted: Sun Jun 22, 2003 10:46 pm
Hi,
I am having problems with php email.
Here is my partial code:
<form name="frmCart" method="get">
<table><tr><td><Qty></td><td>Product</td><td>Price</td></tr>
<?php>
while($row = mysql_fetch_array($result))
{
// Increment the total cost of all dcd_products
$totalCost += ($row["qty"] * $row["price"]);
?>
<tr><td><select name="<?php echo $row["product_id"]; ?>">
<?php
for($i = 1; $i <= 20; $i++){
echo "<option ";
if($row["qty"] == $i){
echo " SELECTED ";}
echo ">" . $i . "</option>";}
?>
</select>
</td><td><?php echo $row["product_id"]; ?></td>
<td>$<?php echo number_format($row["price"]); ?></td></tr>
<?php
}
// Display the total
?>
<tr>
<td>Total: $<?php echo number_format($totalCost); ?></td>
</tr>
</table>
</form>
//php email
<?php
/**********************************************
I want the email to send a list of product_id and totalCost.
I don't know how to append the product_id into array and output
them in the code below.
**********************************************/
$to = " <info@mysite.com>" . ", " ;
$subject = "info";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$message = "
<html> <head> <title>info</title> </head> <body>
Products: ?? don't know what to put??<br>
Price: $totalCost</p>
</body>
</html>";
mail($to, $subject, $message, $headers);
?>
I am having problems with php email.
Here is my partial code:
<form name="frmCart" method="get">
<table><tr><td><Qty></td><td>Product</td><td>Price</td></tr>
<?php>
while($row = mysql_fetch_array($result))
{
// Increment the total cost of all dcd_products
$totalCost += ($row["qty"] * $row["price"]);
?>
<tr><td><select name="<?php echo $row["product_id"]; ?>">
<?php
for($i = 1; $i <= 20; $i++){
echo "<option ";
if($row["qty"] == $i){
echo " SELECTED ";}
echo ">" . $i . "</option>";}
?>
</select>
</td><td><?php echo $row["product_id"]; ?></td>
<td>$<?php echo number_format($row["price"]); ?></td></tr>
<?php
}
// Display the total
?>
<tr>
<td>Total: $<?php echo number_format($totalCost); ?></td>
</tr>
</table>
</form>
//php email
<?php
/**********************************************
I want the email to send a list of product_id and totalCost.
I don't know how to append the product_id into array and output
them in the code below.
**********************************************/
$to = " <info@mysite.com>" . ", " ;
$subject = "info";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$message = "
<html> <head> <title>info</title> </head> <body>
Products: ?? don't know what to put??<br>
Price: $totalCost</p>
</body>
</html>";
mail($to, $subject, $message, $headers);
?>