This is a discussion on PHP email message composing within the PHP General forums, part of the PHP Programming Forums category; Hi all, I am trying to create an automatic email composing script, but I have one big problem here. The ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi all,
I am trying to create an automatic email composing script, but I have one big problem here. The message composing method I'm using is the following: /* message */ $message = ' <html> <head> <title>Solicitud de Presupuesto</title> </head> <body> <SPAN style="FONT-FAMILY: arial; FONT-SIZE: 14px"> El siguiente mensaje ha sido enviado desde la página de presupuesto de icaam.com.ar: </SPAN> <br><br> <table cellspacing="0" cellpadding="5" border="0"> <tr> <td align="right"> [SNIP] And after a while, I have to know which are the options the visitor has selected. The options might vary depending on two different selections, which are "guided" using arrays. What I've done so far, and doesn't work is: '.if (isset($checkbox[0])) {.' <tr> <td align="right" valign="top"> <SPAN style="FONT-FAMILY: arial; FONT-SIZE: 12px">Tipo de Sitio Web</SPAN> </td> <td valign="middle"> '.foreach ($tipo as $key => $value) { echo $value."<BR>"; }.' </td> </tr> }.' [SNIP] Any ideas on why this isn't working? In another rows, I say for example "Name is '.$first_name.'" (without wuotes) and it works just fine but for the "IF" lines it throws me a parse error... How can I solve this? I've even tried with double quote with the same results. Thanks in advanced, Cesar Aracena <http://www.icaam.com.ar> www.icaam.com.ar |
|
|||
|
Instead of putting your message in your code like that, why not just put
it in a seperate text file and do: $message = implode(" ", file("./message")); ? This will make your code look cleaner. So you could create something like: $message = implode(" ", file("./message1")); if (isset($checkbox[0])) { $message .= implode(" ", file("./checkbox1")); } $message .= implode(" ", file("./message2")); foreach ($tipo as $key => $value) { echo $value . '<br>'; } etc. I noticed a lot of .s in your code. I know ;s end statements, but I didn't know dots (concatenation operator) worked to do that as well. Have you tried using semicolons? -Dan |