Jump to content

Recommended Posts

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?>

Link to comment
https://forums.phpfreaks.com/topic/271000-please-help-with-syntax/
Share on other sites

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 by akphidelt2007
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.