Jump to content

[SOLVED] assign string with html


miinet

Recommended Posts

I'm not sure how to assign a string with html tags. The table doesn't show up and neither does the last name. The only thing that is displayed is the first name.

 

$message = 

'<html>

<head>

<title>Confirmation</title>

</head>

<body>

<table cellspacing="7">

<tr>

<td>First Name:</td>

<td>'.$_SESSION['firstname'];'</td>

</tr>

<tr>

<td>Last Name:</td>

<td>'.$_SESSION['lastname'];'/td>

</tr>

</table>

</body>

</html>

';

Link to comment
https://forums.phpfreaks.com/topic/117408-solved-assign-string-with-html/
Share on other sites

<?php

$message = 
'<html>
<head>
<title>Confirmation</title>
</head>
<body>
<table cellspacing="7">
   <tr>
      <td>First Name:</td>
      <td>'.$_SESSION['firstname'].'</td>
   </tr>
   <tr>
      <td>Last Name:</td>
      <td>'.$_SESSION['lastname'].'</td>
   </tr>
</table>
</body>
</html>
';

?>

Hmm.. still doesn't work. Let me post the whole code. I'm actually trying to display the string message in an email.

 

<?php
session_start();

//Basic mail settings
$to = $_SESSION['email'].", ";
$subject  = "Request"; 
$headers  = 'MIME-Version: 1.0' . "rn";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "rn";


// message
$message = 
'<html>
<head>
<title>Confirmation</title>
</head>
<body>
<table cellspacing="7">
   <tr>
      <td>First Name:</td>
      <td>'.$_SESSION['firstname'].'</td>
   </tr>
   <tr>
      <td>Last Name:</td>
      <td>'.$_SESSION['lastname'].'</td>
   </tr>
</table>
</body>
</html>
';

//Send email
mail($to,$subject,$emailmessage,$headers);

?>

 

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.