Jump to content

Fomatting question


jrodd32

Recommended Posts

I have a script that sends e-mail and I am trying to format the body of the message.  right now the code looks like:

[code]
$message="
        ID: $row[id]
        Name: $row[lname] $row[suffix], $row[fname]
        Home Phone: $row[homephone]
        Work Phone: $row[workphone]
        E-Mail: $row[email]


$explaination";
[/code]
I would like for it to be in a table and some other HTML tags that would make it look nicer and more professional.  However, because it is inside the " " the HTML tags just print as they are instead of being functional. 

Is there a way around this method of using the " " to build my message body?

thanks
Link to comment
https://forums.phpfreaks.com/topic/26614-fomatting-question/
Share on other sites


Do you mean the $row[id] is outputted as $row[id] and not the value of $row[id] ? If this is the case, use the concatinate string doohicky.

[code]$message="
        ID: ".$row[id]."
        Name: ".$row[lname]." ". $row[suffix].", ".$row[fname]."
        Home Phone: ".$row[homephone]."
        Work Phone: ".$row[workphone]."
        E-Mail: ".$row[email]."


".$explaination;
[/code]
Link to comment
https://forums.phpfreaks.com/topic/26614-fomatting-question/#findComment-121748
Share on other sites

No if i had some html code it would appear like this:

Ex.

message="

<html><b>ID#:</b></hmtl> $row[id];

etc."

would print exact like:

<html><b>ID#:</b></html> 1002 in the message because PHP prints exactly what is within the " " and I am trying to either get around this or have some other solution to building the message body within the " ".
Link to comment
https://forums.phpfreaks.com/topic/26614-fomatting-question/#findComment-121749
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.