Re: when receiving the mail(php mail function), the variable's last value is getting converted to $ or # replacing the digit [message #179783 is a reply to message #179764] |
Tue, 04 December 2012 18:20 |
John-Paul Stewart
Messages: 1 Registered: December 2012
Karma:
|
Junior Member |
|
|
On 03/12/12 06:38 PM, hara(dot)acharya(at)gmail(dot)com wrote:
> The message as getting displayed on tha same page after sending the mail is:
> "
> Posted successfully. Check your post HERE
> message:
>
> You got a reply for your post title: Anybody up for a online chess game.
>
> Check your post in:
> www.32minutesforum.com/post_clicked.php?id=25.
[snip]
> But when I receive the mail in the mail box:
> It appears as below:
> "
> You got a reply for your post title: Anybody up for a online chess game.
>
> Check your post in:
> www.32minutesforum.com/post_clicked.php?id%.
It looks like you are sending the e-mail with the
"Content-Transfer-Encoding: quoted-printable" header set but you haven't
suitably encoded the content. Either drop the quoted printable header
from your e-mail or properly encode the body!
Quoted printable encoding treats an equal sign as an escape character
followed by two hexadecimal digits for the ASCII code of a character.
So it is the quoted printable encoding (not PHP!) that's changing =25 at
the end of your URL to the % character in the mail.
At a minimum, you'll need to encode the equals sign as =3D in the e-mail
(i.e., "post_clicked.php?id=3D25") -or- drop the quoted printable header
from the e-mail. Better yet would be to run your entire e-mail message
body through PHP's quoted_printable_encode function.
Really, though, it's not a PHP problem but a mismatch between your mail
headers specifying the quoted printable encoding and your body not
actually being encoded.
|
|
|