fahiemoto Posted April 29, 2006 Share Posted April 29, 2006 I downloaded an online webshop and and adjusted it to my needs. It al works fine. But know i want to mail te selected items from the cart to mysef and the person who have selected the items. I know have a mail form but doe not know exactly how to put the selected information in de content of the mail. (both codes can be found beneath) I want the following in my email message: [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]<?$ses_quan$ses_id$item["artikel_soort"]$item["artikel_naam"]$cur_symbol."".number_format($item["artikel_prijs"], 2, '.', '');$cur_symbol."".number_format($subtotal, 2, '.', '');?>[!--colorc--][/span][!--/colorc--]the items from the cart are displayed with the following (fragment) code: <?include "functies_winkelwagen.php";$totalvalue = 0;session_start();// If no sessions has been started $_SESSION["cart"] equals null, thus showing the message no items.if (!isset($_SESSION["cart"])) { $_SESSION["cart"] = NULL;}if (validate() == TRUE && $_SESSION["cart"] != NULL) { foreach ($_SESSION["cart"] as $key => $session_data) { list($ses_id, $ses_quan) = $session_data; // call database connect function db_connect(); $sel_products = mysql_query("SELECT * FROM $mysql_tablename WHERE artikel_code=".$ses_id.""); $item = mysql_fetch_array($sel_products); $totalvalue = $totalvalue + ($item["artikel_prijs"]*$ses_quan); $subtotal = ($item["artikel_prijs"]*$ses_quan); ?> [!--coloro:#33CC00--][span style=\"color:#33CC00\"][!--/coloro--]<tr bgcolor="#FFFFFF" class="style32" > <td class="style32"><? echo $ses_quan; ?> <input name="eid[]" type="hidden" id="eid[]" value="<? echo $ses_id; ?>"></td> <td class="style32"><!--DWLayoutEmptyCell--> </td> <td class="style32"><span class="style15"><? echo $item["artikel_naam"]; ?></span></td> <td colspan="2" class="style32"><span class="style15"><? echo $cur_symbol. "".number_format($item["artikel_prijs"], 2, '.', ''); ?></span></td> <td width="91" class="style32"><div align="right"><span class="style15"><? echo $cur_symbol. "".number_format($subtotal, 2, '.', ''); ?></span></div></td> <td bgcolor="#FFFFFF" class="dividingborder"><!--DWLayoutEmptyCell--> </td>[!--colorc--][/span][!--/colorc--] </tr> <? } // end foreach loop } elseif ($_SESSION["cart"] == NULL) { echo "woo"; } else { echo "woohoohoo";} ?>the email (fragment) code is as followed:<?$content_webmaster = " Bedrijfsnaam: ".$_SESSION['bedrijfsnaam']." Naam: ".$_SESSION['naam']." ".$_SESSION['naam']."Contactpersoon:".$_SESSION['bedrijfsnaam']." Adres: ".$_SESSION['straat']." ".$_SESSION['straat_nr']." ".$_SESSION['straat_tv']." ".$_SESSION['postcode']." ".$_SESSION['plaats']."======================================================================Test: [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]IN HERE I WANT THE CONTENT OF THE CART[!--colorc--][/span][!--/colorc--] ============================================================================================================================================Note: ".$_SESSION['naam']." stuurde deze email op ".date("d-m-Y")." om ".date("H:i").". Het IP adres van ".$_SESSION['naam']." is: ".$ipadres." Het hostadres van ".$_SESSION['naam']." is: ".$hostmask."======================================================================";?> Link to comment https://forums.phpfreaks.com/topic/8728-session-in-email-e-commerce/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.