Skip to content
Advertisement

Cannot concatenate with the link

Hello why is it that I cannot include in the link when I concatenate?

here is the code.

$mail->Subject = 'Verification Link';
 $mail->Body    = 'http://localhost/Mailer/verification.php?code='.$user_verificationCode;
 $mail->AltBody = 'http://localhost/Mailer/verification.php?code='.$user_verificationCode;

But the $userverifcation is not included in the link even when I concatenate it? Here is the sample link: http://localhost/Mailer/verificationForgot.php?code= Zk8gIT

enter image description here

As you can see it is not included in the link? WHat should I do?

Advertisement

Answer

You have a space in $user_verificationCode. You should use trim to remove it before append to URL.

$mail->Subject = 'Verification Link';
$mail->Body    = 'http://localhost/Mailer/verification.php?code='.trim($user_verificationCode);
$mail->AltBody = 'http://localhost/Mailer/verification.php?code='.trim($user_verificationCode);
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement