Hi,
I'm trying to email information from a form. Here is the essential code (not complete...part I have figured out already):
$fields = array();
$fields{"Name"} = $SESSION['Name'];
$fields{"Phone_Number"} = $SESSION['Phone_Number'];
$fields{"E_Mail"} = $SESSION['E_Mail'];
$fields{"Servings"} = $SESSION['Servings'];
$fields{"Keiki_Servings"} = $SESSION['Keiki_Servings'];
$fields{"Pick_up_Time"} = $SESSION['Pick_up_Time'];
$body = "You have received the following order:\n\n";
foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }
$submit = mail($to, $subject, $body, $headers)
?>
<tr>
<td class="bodyText">
<p>Your order will be placed for : <span class="style9"><?php echo $_SESSION['Menu_Date']; ?></span></p>
<p>Order for : <span class="style9"><?php echo $_SESSION['Name']; ?></span></p>
<p>Contact info : <span class="style9"><?php echo $_SESSION['E_Mail']; ?> <?php echo $_SESSION['Phone_Number']; ?></span></p>
<p>Menu Item: <span class="style9"><?php echo $_SESSION['Menu_Item']; ?></span></p>
<p>Number of Servings: <span class="style9"><?php echo $_SESSION['Servings']; ?></span></p>
<p>Number of Keiki Servings: <span class="style9"><?php echo $_SESSION['Keiki_Servings']; ?></span></p>
<p>Subtotal: <span class="style9">$<?php echo $_SESSION['subtotal']; ?></span></p>
<p>Tax: <span class="style9">$<?php echo $_SESSION['tax']; ?></span></p>
<p>Total Due at Pick Up: <span class="style9">$<?php echo $_SESSION['total_due']; ?></span></p>
<p>Estimated Pick Up Time: <span class="style9"><?php echo $_SESSION['Pick_up_Time']; ?></span></p>
<form method="post" action="thank_you.php">
<label>
<input type="submit" name="Confirm" id="Confirm" value="Confirm" />
</label>
</form>
Basically, I cannot figure out how to get all the info you see in the SESSION variables to go into the body of the message. I'm getting the data, but I can't figure out how to get it to show the data label (like Email, Name, etc). I'm sure it's an echo statement, but nothing is working.
It's only info in the body that I'm having problems with. I have the rest figured out.
Any help would be appreciated!
Mark