lingo5 Posted November 21, 2012 Share Posted November 21, 2012 hi, I have a php mail script that includes html also My problem is that I have to echo some php variables that are inside php tags...how do i do that?. See example in red. If I remove the php tags fromthe variable it does not echo. Please help !!!! <?php $strTo = $_POST["txtTo"]; $strSubject = stripslashes($_POST["txtSubject"]); $strMessage = '<font face="tahoma,arial" size=2>'."Hola\n\n" .$_POST["companyname"]. "<br>alguien ha hecho un pedido:<p>Nombre:\n\n".$_POST["nombre"]."<br>Apellidos:\n\n".$_POST["apellidos"]."<br>Direccion:\n\n".$_POST["tipo_via"].$_POST["nombre_via"]."<br>Ciudad:\n\n".$_POST["poblacion"]."<br>C.P.:\n\n".$_POST["cp"]."<br>Provincia:\n\n".$_POST["provincia"]."<br>Telefono:\n\n".$_POST["telefono"]."<br>Movil:\n\n".$_POST["movil"]."<br>Email:\n\n".$_POST["email"]."<br>Importe Total:\n\n".$totalemail.""; if (!$enersolmaCart->IsEmpty()) { $strMessage.='<h2 style="color:#578557; /* Accent_1 */ margin-bottom:7px; font-size:medium;">Your Shopping Cart</h2> <table width="100%" style=" border-right:solid 1px #CAD0CD; /* Neutral_Medium */ border-left:solid 1px #CAD0CD; /* Neutral_Medium */ border-bottom:solid 1px #CAD0CD; /* Neutral_Medium */ margin-bottom:14px;" border="0" cellspacing="0" cellpadding="0"> <tr> <th style="padding:10px 14px 10px 7px; vertical-align:top; text-align:left; background-color:#578557; /* Accent1 */ color:#FFFFFF; /* Global_White */" text-align:left;>Name</th> <th style="padding:10px 14px 10px 7px; vertical-align:top; text-align:right; background-color:#578557; /* Accent1 */ color:#FFFFFF; /* Global_White */" text-align:right;>Price</th> <th style="padding:10px 14px 10px 7px; vertical-align:top; text-align:right; background-color:#578557; /* Accent1 */ color:#FFFFFF; /* Global_White */" text-align:right;>Shipping</th> <th style="padding:10px 14px 10px 7px; vertical-align:top; text-align:right; background-color:#578557; /* Accent1 */ color:#FFFFFF; /* Global_White */" text-align:right;>IVA</th> <th style="padding:10px 14px 10px 7px; vertical-align:top; text-align:right; background-color:#578557; /* Accent1 */ color:#FFFFFF; /* Global_White */" text-align:right;>Total</th> </tr>'; while (!$enersolmaCart->EOF()) { $strMessage.=' <tr> <td style="padding:10px 14px 10px 7px; vertical-align:top;" ><?php echo $enersolmaCart->DisplayInfo("Name"); ?></td> <td style="padding:10px 14px 10px 7px; vertical-align:top; text-align:right;" >[color=#FF0000]<?echo WA_eCart_DisplayMoney($enersolmaCart, $enersolmaCart->DisplayInfo("Price")); ?>[/color][color=#000000]</td[/color]> <td style="padding:10px 14px 10px 7px; vertical-align:top; text-align:right;" ><?php echo WA_eCart_DisplayMoney($enersolmaCart, $enersolmaCart->DisplayInfo("Shipping")); ?></td> <td style="padding:10px 14px 10px 7px; vertical-align:top; text-align:right;" ><?php echo WA_eCart_DisplayMoney($enersolmaCart, $enersolmaCart->DisplayInfo("IVA")); ?></td> <td style="padding:10px 14px 10px 7px; vertical-align:top; text-align:right;" ><?php echo WA_eCart_DisplayMoney($enersolmaCart, $enersolmaCart->DisplayInfo("TotalPrice")); ?></td> </tr>'; php?> Quote Link to comment https://forums.phpfreaks.com/topic/271000-please-help-with-syntax/ Share on other sites More sharing options...
akphidelt2007 Posted November 21, 2012 Share Posted November 21, 2012 (edited) You are storing the php in a variable so there is no reason to need the php tags and to echo anything. <td style="padding:10px 14px 10px 7px; vertical-align:top; text-align:right;">'.WA_eCart_DisplayMoney($enersolmaCart, $enersolmaCart->DisplayInfo("Shipping")).'</td> At the end of the script you have to echo out $strMessage Edited November 21, 2012 by akphidelt2007 Quote Link to comment https://forums.phpfreaks.com/topic/271000-please-help-with-syntax/#findComment-1394201 Share on other sites More sharing options...
lingo5 Posted November 21, 2012 Author Share Posted November 21, 2012 omg akphidelt2007.....I'm such an "·$%&t... Thanks !!! Quote Link to comment https://forums.phpfreaks.com/topic/271000-please-help-with-syntax/#findComment-1394203 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.