Jump to content

Recommended Posts

I have a Variable $emailmessage that has html in it and to make it customized it also has the reader’s name. That was submitted by the form. So it looks something like this.

 


$name2 = $_POST['guestname2'];

$emailmessage= '
<html>
  <body bgcolor="white">

<table align="center" border="1" bordercolor="gray" width="400px">
    <tr>
       <td>
        <font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt">Dear $name2</font><br/><br/>
</tr>
      </td>
</table>
</body>
</html>';

 

when I send my emailmessage it does not show the value of $name2 it just shows $name2

Link to comment
https://forums.phpfreaks.com/topic/84315-solved-using-variables-in-variables/
Share on other sites

This will work mate

 

$name2 = $_POST['guestname2'];

$emailmessage= '
<html>
  <body bgcolor="white">

<table align="center" border="1" bordercolor="gray" width="400px">
    <tr>
       <td>
        <font style="font-family:verdana,arial,helvetica; font-color=GRAY; font-size=14pt">Dear '.$name2.'</font><br/><br/>
</tr>
      </td>
</table>
</body>
</html>';

 

Regards

Liam

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.