I try to insert the code below as html message to email any client but I always get this:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
I know i must covert " to ' but mysql is always having trouble
PHP Code:
$html_message ="<td height='12' bgcolor='#FFFFFF'><p align='center'>ITEM(s) ORDERED</p> <table width="229" border="0"> <tr> <td width="10"> </td> <td width="77"><div align="center">ITEM</div></td> <td width="59"><div align="center">QTY</div></td> <td width="65"><div align="center">PRICE</div></td> </tr> <?php include('admin_config.php'); $visitid = getenv('REMOTE_ADDR'); $query21 = 'SELECT * FROM cart WHERE visitid='$visitid''; $result21 = mysql_query($query21); while($row = mysql_fetch_assoc($result21)) {
$qty1 = $row['qty']; $code1 = $row['code']; ?> <tr> <td></td> <td><div align="center"><?php echo $row['code']; ?></div></td> <td><div align="center"><?php echo $row['qty']; ?></div></td> <td><div align="center">$ <?php $query1 = 'SELECT * FROM item WHERE code='$code1''; $result1 = mysql_query($query1); while($row = mysql_fetch_assoc($result1)) { $price = $row['price']; echo $price; //$stocks = $row['$stocks']; } ?></div></td> </tr><?php $sub = $qty1 * $price; $total = $total + $sub; } ?> </table>";
mail($receiver, $subject, $html_message,$header);
Last edited by chrishirst; 01-24-2009 at 01:46 PM..
|