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
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>
';

?>

Link to comment
Share on other sites

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);

?>

 

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.