I am using a html email template for my account verification via email
so in my "register_session.php" i have integrated the PHPMailer and all in order to send an email to user. I have the following code:
$email = $_REQUEST['email']; //to
$subject = 'Account Verification';
$message = file_get_contents('../emailhtml.php', FILE_USE_INCLUDE_PATH);
$header = 'From:Test' . "\r\n" .
'Content-type: text/html; charset=iso-8859-1\r\n'; //set FROM HEADER
mail ($email, $subject, $message, $header);
In my $message
I used file_get_contents
to retrieve the html code in emailhtml.php
. Inside of emailhtml.php
, I have my html & css code. See below:
<?php
include("../web/Includes/database_master_mysql.php");
$database_master = new DatabaseMaster();
$email = $_GET['email'];
$code = $_GET['code'];
?>
<html>
<head></head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="50%" class="emailButton" style="background-color: #3498DB;">
<tr>
<td align="center" valign="middle" class="buttonContent" style="padding-top:15px;padding-bottom:15px;padding-right:15px;padding-left:15px;">
<a style="color:#FFFFFF;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:20px;line-height:135%;" href=" <?php echo'http://localhost/web/web/emailactivate.php?email='.$email.'&code='.$code.'';?> ">Confirmation</a>
</td>
</tr>
</table>
</body>
</html>
I didn't put all the code because what my concern is in my href tag I wanted to redirect user upon clicking the button in their email to http://localhost/web/web/emailactivate.php?email='.$email.'&code='.$code.'
but what shows up in mine is:
http://localhost/web/web/emailactivate.php?email%20=%3C?php%27.$email.%27?%3E&code=%3C?php%27.$code.%27%20?%3E
I'm not really knowledgeable in PHP so it would mean a world to me if you'll help me. Thank you.