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
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
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
Share on other sites

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.