I’m using the mail() function to send an email activation link to any registered user. This is the message:
`$message = "
<html lang='en'>
<body>
<h1 style='text-align: center; color: blue;'>You're about to become a new member of Connection!</h1>
<a href='$link' style='text-decoration: none; font-size: 2em; font-weight: bold; color: #3523FA;'>
<div style='width: 40%; height: 20%; border: 3px solid #4057ED; background-color: #40E2ED; text-align: center; margin: auto;'>
<p>Click here to activate your account!</p>
</div>
</a>
";However, the link is equal to nothing. I've usedecho $link;to make sure it's right, and$link` is equal to what I wanted it to equal. How do I include this variable in my PHP message?
So there’s something wrong with the way you are assigning the value to $message or something setting $link to blank in between where you were checking it and the assignment to $message
Oh hey! You were actually right! $link wasn’t a global variable, since it was within a function. Thanks for this advice:
So there’s something wrong with the way you are assigning the value to $message or something setting $link to blank in between where you were checking it and the assignment to $message