This is the method I am attempting to use whilst trying to "send" a shopping cart to the admin. It may be an unorthodox method please any suggestions would be more than welcome.
This information is coming from a session plus a separate script which is all working well. It displays cart contents which I then am trying to send via email as well as some personal information:
<?php foreach ($quotes as $quote): ?>
<tr>
<td class="quoteTdL"><h3><?php echo htmlspecialchars($quote['name'], ENT_QUOTES,'UTF-8'); ?></h3></td>
<td class="quoteTdR"><p><?php echo htmlspecialchars($quote['text'], ENT_QUOTES,'UTF-8'); ?></p></td>
</tr>
<?php endforeach; ?>
Essentially I would like to include this information within this cut down mail script:
//send email
$to = "";
$fname = $_REQUEST['fname'] ;
$sname = $_REQUEST['sname'] ;
$email = $_REQUEST['email'] ;
$pnum = $_REQUEST['pnum'] ;
$mnum = $_REQUEST['mnum'] ;
$content = $_REQUEST['content'] ;
$subject = 'Email from SAiGE Longlife website';
$msg = '
<html>
<head>
<title>SAiGE Longlife Decking enquiry</title>
</head>
<body>
<table width="600" border="0" align="center" cellpadding="10">
<tr>
<td colspan="2" align="center" bgcolor="#FF9933" style="font: 18px Arial,Georgia,Serif; color:#fff;">SAiGE Longlife Decking enquiry</td>
</tr>
<tr>
<td width="200" bgcolor="#CCCCCC" style="font: 18px Arial,Georgia,Serif; color:#fff;">Name:</td>
<td width="400" bgcolor="#FF9933" style="font: 18px Arial,Georgia,Serif; color:#000;">';
$msg .=$fname;
$msg .=' ';
$msg .=$sname;
$msg .='
</td>
</tr>
<tr>
<td bgcolor="#CCCCCC" style="font: 18px Arial,Georgia,Serif; color:#fff;">E-mail</td>
<td bgcolor="#FF9933" style="font: 18px Arial,Georgia,Serif; color:#000;">';
$msg .=$email;
$msg .='
</td>
</tr>
<tr>
<td bgcolor="#CCCCCC" style="font: 18px Arial,Georgia,Serif; color:#fff;">Phone numbers:</td>
<td bgcolor="#FF9933" style="font: 18px Arial,Georgia,Serif; color:#000;">';
$msg .=$pnum;
$msg .='
</td>
</tr>
<tr>
<td bgcolor="#CCCCCC"> </td>
<td bgcolor="#FF9933" style="font: 18px Arial,Georgia,Serif; color:#000;">';
$msg .=$mnum;
$msg .='
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" bgcolor="#CCCCCC" style="font: 18px Arial,Georgia,Serif; color:#fff;">Message:</td>
</tr>
<tr>
<td colspan="2" bgcolor="#FF9933" style="font: 18px Arial,Georgia,Serif; color:#000;">';
$msg .=$content;
$msg .=$cartHtml;
$msg .='
</td>
</tr>
</table>
</body>
</html>
';
I have tried imploding and integrating the foreach side of things but to no luck and have spent a long time on it!
Is it possible to output the loop first as a variable and then include or is this unnecessary?
All help would be appreciated.
Many thanks,
Tom