views:

29

answers:

1

Hi folks,

I have probably a stupid problem. In a script I generate a URL with GET parameters, something like 'www.mydomain.com/index.php?item=1234'. This URL will be sent by PHP through mail() in an UTF-8 encoding (the scriptfile itself also is utf-8). Now each time I have the GET-Parameter with two numbers after the '=' the URL in the email looks like 'www.mydomain.com/index.php?item□34' with a rectangle instead of '=12'. I am sure there is an easy way to fix this?

Thanks in advance,

Maenny

+1  A: 

You must be using quoted-printable encoding in which encoding sequences start with =. Instead of struggling with encoding manually, choose a mail library which does that (and a lot more) for you. I recommend PHPmailer.

Also, url parameters are ugly. It is very easy to set nice urls via the Apache mod_rewrite module and use urls like www.mydomain.com/item/1234, which has the added benefit of being implementation-independent and somewhat more SEO-friendly. (For full SEO-friendliness use www.mydomain.com/item/my-cool-item or at least www.mydomain.com/item/1234/my-cool-item.)

Tgr
The minimalistic solution, which I would strongly recommend against, is replacing `=` with `=3D`.
Tgr
Thx I found this:http://www.php.net/manual/de/function.quoted-printable-encode.phpand added the function to my includes.
Maenny