ukferret Posted April 9, 2007 Share Posted April 9, 2007 Firstly here is the code; <?php $username = $_SESSION['username']; $to = $_SESSION['email']; $subject = 'Snooker Profiles Registratin Confirm'; $message = '<b>Welcome to our website</b><br/><br/>Your Username is- $username'; $headers = 'From: mail@domain.com' . "\r\n" . 'Reply-To: mail@domain.com' . "\r\n" . 'Return-Path: mail@domain.com' . "\r\n" . 'Content-type: text/html; charset=iso-8859-1' . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $message = wordwrap($message, 70); mail($to, $subject, $message, $headers); ?> I have several SESSIONS being sent from a previous page and I want to put the info in the SESSION into the body of the email, this line; $message = '<b>Welcome to our website</b><br/><br/>Your Username is- $username'; is where I am having the problems! the SESSION I have changed into a string and the string prints out as $username instead of the value. I am sure I need to escape it again but I just can not get my head around it, can anybody help? Quote Link to comment Share on other sites More sharing options...
MadTechie Posted April 9, 2007 Share Posted April 9, 2007 Use double quotes not single ie <?php $message = "<b>Welcome to our website</b><br/><br/>Your Username is- $username"; ?> Quote Link to comment Share on other sites More sharing options...
ukferret Posted April 9, 2007 Author Share Posted April 9, 2007 Cheers MadTachie That wouldn't of even crossed my mind all works great now, thanks. Quote Link to comment Share on other sites More sharing options...
MadTechie Posted April 9, 2007 Share Posted April 9, 2007 when i started i found that out by mistake click solved please Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.