Insert PHP inside HTML -


i trying out php mail service getting variable db , insert value html test trying out this:

<?php include("db/dbvalue.php"); include("emailfun/email.php");      $response = array();     $emailaddress = "probh@pro.com";      $dt = new datetime();     echo $dt->format('m-d');     $m =  $dt->format('m');     $d =  $dt->format('d');      $result = mysql_query("select * namevalue type = 'boys' , month = '$m' , date = '$d'");        if (mysql_num_rows($result) > 0)    {       while ($row = mysql_fetch_array($result))      {         $name = $row["name"];         $to= $emailaddress;         $subject ="congratulations";         $message=" <html> <head> <title>html email</title> </head> <body> <p>name goes here: <?php echo $name; ?> </p>  </body> </html> ";          $from = "mailsender@pro.com";         $fromname = "mail sender";         send_html_mail($to, $subject, $message, $from, $fromname);      }   }    else   {     echo("nothing today");     } ?> 

i receiving mail "name goes here:"

i not able variable inserted in html @ all.

can me fix this?

thanks!

the line passing name email message should be:

<p>name goes here: " . $name . "</p>  

full $message content be:

$message="     <html>     <head>     <title>html email</title>     </head>     <body>     <p>name goes here: " . $name . "</p>      </body>     </html> ";  

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -