aquatradehub Posted October 12, 2012 Share Posted October 12, 2012 (edited) Hi, I have this code to send an email once a user has registered. I would like to display the $email variable in the email, but the validation link just shows up exactly as it was written, and does not display the $email variable as it should be; the persons email address. It sends the email ok, so I am confused as to why it is not displayed. Sorry, I cannot select the code tags. /* Send validation email */ // recipients // subject $subject = 'AquaTradeHub.com Validation Email'; // message $message = ' <p>Thank you for registering with AquaTradeHub.com</p> <br> <p>Please validate your account <a href="http://www.zambiheadshop.com/validate.php?email=$email">Click here</a>'; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: AquaTradeHub.com <validate@aquatradehub.com>' . "\r\n"; // Mail it mail($email, $subject, $message, $headers); /* Redirect visitor to the thank you page */ header('Location: thanks.php'); exit(); }} Any help is much appreciated. The email variable is defined earlier in the script. Edited October 12, 2012 by aquatradehub Quote Link to comment Share on other sites More sharing options...
Jessica Posted October 12, 2012 Share Posted October 12, 2012 Oh my god. What is it with this today? I have never seen this so many times in one day. I know there's more than just these ones too. http://forums.phpfreaks.com/topic/269357-making-sure-usernames-are-not-duplicated/page__st__20#entry1384854 http://forums.phpfreaks.com/topic/269398-passing-custom-field-into-wordpress-query-posts-array/#entry1384849 http://forums.phpfreaks.com/topic/269391-adding-radio-buttons-to-a-mysql-database-list/#entry1384783 Quote Link to comment Share on other sites More sharing options...
aquatradehub Posted October 12, 2012 Author Share Posted October 12, 2012 whoa, calm down lol, some of us are pretty new to this. Anyway, I got what u said, and now it works /* Send validation email */ // recipients // subject $subject = 'AquaTradeHub.com Validation Email'; // message $message = " <p>Thank you for registering with AquaTradeHub.com</p> <br> <p>Please validate your account <a href='http://www.zambiheadshop.com/validate.php?email=$email'>Click here</a>"; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: AquaTradeHub.com <validate@aquatradehub.com>' . "\r\n"; // Mail it mail($email, $subject, $message, $headers); /* Redirect visitor to the thank you page */ header('Location: thanks.php'); exit(); }} Thanks Quote Link to comment Share on other sites More sharing options...
Jessica Posted October 12, 2012 Share Posted October 12, 2012 Use code tags next time. Quote Link to comment Share on other sites More sharing options...
aquatradehub Posted October 12, 2012 Author Share Posted October 12, 2012 As I said at the beginning of this topic " Sorry, I cannot select the code tags." I dont know why, but I cant change font, size, code, link whatever, its all pale and does not do anything when I click on them apart from highlighting that icon Quote Link to comment Share on other sites More sharing options...
Jessica Posted October 12, 2012 Share Posted October 12, 2012 (edited) Click the lightswitch in the top left. Does that change it? Are you selecting the text and then clicking the icon? What browser are you using? etc. Also, you can just type [ code ] and [ /code] without the spaces. Edited October 12, 2012 by Jessica Quote Link to comment Share on other sites More sharing options...
aquatradehub Posted October 12, 2012 Author Share Posted October 12, 2012 thanks, that worked 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.