Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying variable in body of html email 1

Status
Not open for further replies.

dugen

Programmer
Jun 16, 2003
59
US
Hi,

I would like to display the variable $name right after the words thank you in the body of this html email. I appreciate any help. THanks

$name = $REQUEST['txtname'];

$message = '
<html>
<head>
<title>Welcome to Meadowbrook Pointe!</title>

</head>
<body><center>
<font size="2" face="Geneva, Arial, Helvetica, sans-serif">
<img src=" border=5><br><br>
Thank you $name for visiting...
</body>
</html>';

$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to, $subject, $message, $headers);
 
try
Code:
$_REQUEST['txtname'];
you missed off the underscore.

but it is better (much) to reference the correct superglobal. e.g. $_POST['txtname'] or $_GET['txtname']
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top